Question

I'm getting this error message, and trying to figure out why. Check 1 failed Output: What...

I'm getting this error message, and trying to figure out why.

Check 1 failed

Output:

What would you like to do?

Expected:

What would you like to do? Thank you for banking with us.

ATM Summary

Your final function in the ATM Script is the Print the Customer summary as follows:

Final Input

userchoice = input ("What would you like to do?\n")
userchoice = 'Q'

Final Output

What would you like to do?
Thank you for banking with us.

ATM Summary Feedback Available

If you would like our automated system to review your code and give you some feedback on your project before you submit for a grade, just click the Help Me! button below.

Trying to add to this Script:

import sys # importing the sys library

# account balance

account_balance = float(500.25)

# PPrint the balance

# This is a custom function, it returns the current balance upto 2 decimal places

def printbalance():

print('Your current balance: $%.2f'%account_balance)


# the function for deposit

# This is a custom function

def deposit():

# takes in input for deposit amount

deposit_amount = float(

input("How much would you like to deposit today?\n"))

balance = account_balance + deposit_amount # calculates balance

print("Deposit was $%.2f, current balance is $%.2f" %

(deposit_amount, balance)) # prints out the balance

# function for withdraw

# this is a custom function

def withdraw():

# takes in the withdraw amount

withdraw_amount = float(input("How much would you like to withdraw today?\n"))

if(withdraw_amount > account_balance): # checks whether the amount is more than balance or not

print("$%.2f is greater than your account balance of $%.2f\n"

%(withdraw_amount, account_balance)) # if yes then

else:

balance = account_balance - withdraw_amount

print("withdrawal amount was $%.2f, current balance is $%.2f" %

(withdraw_amount, balance))

# User Input goes here, use if/else conditional statement to call function based on user input

userchoice = input("What would you like to do?\n")

if (userchoice == 'D'):

# here deposit function is called

deposit()

elif userchoice == 'W':

# here withdraw function is called

withdraw()

elif userchoice == 'B':

# here printbalance function is called

balance = printbalance()
  

else:

# it ends the program execution

sys.exit()

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

Output:

N.B. There are no error! I have checked your code, it works fine. I just add a quit message and add a condition for quit. I think your code has indentation problem. Write your code with proper indentation, with the help of my code. Still if you face any problem, then share in the comment section with error message, I'll help you.

Add a comment
Know the answer?
Add Answer to:
I'm getting this error message, and trying to figure out why. Check 1 failed Output: What...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Calculate the Balance - Withdrawal If the action is Withdrawal ‘W’, use the withdrawal function to...

    Calculate the Balance - Withdrawal If the action is Withdrawal ‘W’, use the withdrawal function to remove funds from the account Hint – The formatter for a float value in Python is %f. With the formatter %.2f, you format the float to have 2 decimal places. For example: print("Account balance: $%.2f" % account_balance) Withdrawal Information Withdraw Input userchoice = input ("What would you like to do?\n") userchoice = 'W' withdrawal_amount = 100 Withdraw Output What would you like to do?...

  • Hello, In Python Enhance the prior assignment by doing the following 1) Create a class that...

    Hello, In Python Enhance the prior assignment by doing the following 1) Create a class that contain all prior functions MyLib # This function adds two numbers def addition(a, b): return a + b # This function subtracts two numbers def subtraction(a, b): return a - b # This function multiplies two numbers def multiplication(a, b): return a * b # This function divides two numbers # The ZeroDivisionError exception is raised when division or modulo by zero takes place...

  • A group of new college graduates want to know if they save a certain amount of...

    A group of new college graduates want to know if they save a certain amount of money every month for a certain amount of years, how much saving they are going to get after certain amount of time. Write a python program to help them out. Ask the user to input how much they plan to save per month; how many years (integer) they are going to keep on saving the money; every how many years do they expect to...

  • Trying to figure out how to complete my fourth case 4 (option exit), write a function...

    Trying to figure out how to complete my fourth case 4 (option exit), write a function that display a “Good Bye” message and exits/log out from user’s account displaying a menu (sign in, balance, withdraw and exit.. #include<iostream> #include <limits> using namespace std; void printstar(char ch , int n); double balance1; int main() { system("color A0"); cout<<"\n\t\t ========================================="<< endl; cout<<"\t\t || VASQUEZ ATM SERVICES ||"<< endl; cout<<"\t\t ========================================\n\n"<< endl; int password; int pincode ; cout<<" USERS \n"; cout<<" [1] -...

  • I need help with this code, I have it started here import sys import turtle menu...

    I need help with this code, I have it started here import sys import turtle menu = "Press 1 for Flower" UserChoice = input(menu) #function to draw squares def draw_square(square): for i in range(0,2): square.forward(100) square.right(70) square.forward(100) square.right(110) #function to draw flower def draw_flower(petalNumber): window = turtle.Screen() window.bgcolor("yellow") pen = turtle.Turtle() pen.shape("triangle") pen.color("red")    for number in range(0,petalNumber): draw_square(pen) pen.right(360/petalNumber) for i in range(0,4): pen.circle(20) pen.right(90)    pen.right(90) pen.forward(300) pen.right(90) draw_square(pen) pen.left(180) draw_square(pen) pen.left(270) pen.forward(200) window.exitonclick() #function for original art...

  • I am trying to create a ATM style bank program that accept the customer id ,...

    I am trying to create a ATM style bank program that accept the customer id , in the welcoming panel ,but how do i make when the customer input their id# and click on the ok button then they have 3 or so tries to input the correct id# and if successful then send to the other panel where they choose which transaction to they want to make for example savings , checking account , make and deposit , and...

  • what am I missing? this should be the output: (B)udget, (D)aily, or (W)eekly rental? B Starting...

    what am I missing? this should be the output: (B)udget, (D)aily, or (W)eekly rental? B Starting Odometer Reading: Ending Odometer Reading: 1234 2222 988 247.00 my output is this: (B)udget, (D)aily, or (W)eekly rental? Starting Odometer Reading: Ending Odometer Reading: 1234 2222 988 247.00 here's my code so far: import sys ''' Section 1: Collect customer input ''' #Add customer input 1 here, rentalCode = input("(B)udget, (D)aily, or (W)eekly rental?") #Collect Customer Data - Part 2 #4)Collect Mileage information: ##a)...

  • Module 6 - Cash Register (10 Points) We are going to write a program that simulates...

    Module 6 - Cash Register (10 Points) We are going to write a program that simulates a customer's transaction at a cash register. You will organize your code using functions. Each of the functions below counts for 2 points. You must create functions allowing the user to: 1. Add an item to the order. No name or list of items is needed simply prompt the user for a dollar amount to add. 2. Clear all transactions. Set the amount of...

  • Please help me with the code. Thank you! Description James Vond has delivered us some intel...

    Please help me with the code. Thank you! Description James Vond has delivered us some intel that the enemy perpetrators have been tricked into going to a bank that we've wired and booby-trapped. However, we have not gotten a bank system in place and you are the only person who is capable of handling such a task. We need this plan to go off without a hitch because the money we'll be receiving will give us insight on the hideout's...

  • Using python 3.6 How do I incorporate 0 or negative input to raise an error and...

    Using python 3.6 How do I incorporate 0 or negative input to raise an error and let the user try again? like <=0 #loop to check valid input option. while True: try: choice = int(input('Enter choice: ')) if choice>len(header): print("Invalid choice!! Please try again and select value either:",end=" ") for i in range(1,len(header)+1): print(i,end=",") else: break choice = int(input('\nEnter choice: ')) except ValueError as ve:print('Invalid response, You need to select the number choice from the option menu') # Catch your...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT