Question: Using c++ For this exertise, we will implement an interactive ATM program that repeatedly allows the user to view their balance, make a deposit, make

Using c++

Using c++ For this exertise, we will implement an interactive ATM program

For this exertise, we will implement an interactive ATM program that repeatedly allows the user to view their balance, make a deposit, make a withdrawal, or quit. Declare global variables to represent your user's savings and checking balances. Global variables are variables that are declared outside of all functions (in the global namespace), and are accessible by all functions, including main. Using global variables will allow you to use them inside any of the functions and allow you to make changes that will affect the global variables. Next, prompt the user for the action they wish to take. The program should then ask the user which account they would like to perform that action on (Savings or Checking). After obtaining the desired action and account, your program should make a function call to one of the following functions: void print_balance(string account); - The string parameter account is equal to Sn if they wish to see their savings balance, " C if they wish to see their checking balance, or " B to see both balances. - The function prints the user's account balance(s). void deposit(string account); - The string parameter account is equal to " S if they wish to deposit into their savings, or " C if they wish to deposit into their checking. - The function prompts the user for the amount they wish to deposit into the desired account. - After depositing the amount, this function calls print_balance() to show their account's new balance. void withdraw(string account); - The string parameter account is equal to " S " if they wish to withdraw from their savings, or " C " if they wish to withdraw from their checking. - The function prompts the user for the amount they wish to withdraw from the desired account. - The function checks if the amount is valid (if it is less than or equal to what they have in their account). - If it is valid, then the function withdraws the amount and calls print_balance () to show their account's new balance. - If the withdrawal is not valid, then the function deducts a $3.00 penalty fee from their account, displays a message relaying the deduction, and calls print_balance() to print their account's new balance. Once the user has selected to quit, display the final balances for both accounts. Be sure to test your program thoroughly to show that all functions work

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!