Question: Programming Specifications in Python Define a global variable called total. Initialize this variable to 0 . 0 0 . Define a function called AddMoney. This
Programming Specifications in Python
Define a global variable called total. Initialize this variable to
Define a function called AddMoney. This function takes one parameter, an amount to credit to the bank. Add the supplied amount to the total.
Define a function called SubtractMoney. This function takes one parameter, an amount to debit from the bank. First, add a conditional to check if there are sufficient funds in the bank. Hint: debitAmount total. If there is enough money in the bank, debit the account. Otherwise if there is not enough money, notify the user, but do not subtract the amount.
In the main file, print out a menu to the user, here are the menu options:
Print total
Add money
Remove money
Quit
Create a whileloop to loop forever. While inside the whileloop:
Ask the user to input a menu option.
Add a conditional to check the user's input.
If then print the total amount to the user.
If then prompt the user for an amount to add. Convert this string to a number. Then call the AddMoney function with the given amount.
If then prompt the user for an amount to remove. Convert this string to a number. Then call the SubtractMoney function with the given amount.
If then break out of the while loop and end the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
