Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ATM Simulator ill write the code to help the Oiler Bank get their ATM up and run

ID: 3878319 • Letter: A

Question

ATM Simulator ill write the code to help the Oiler Bank get their ATM up and running. To start out, your On startup, the In today's lab you version will only have a few operations. Assume that the user has an initial balance of $1,000.00 program should display the balance and this menu: **Oiler Banking** [D] Deposit [W] Withdraw [B] Balance [X] Done Have the user enter a character selection (D, W ,B, or X) and perform the operation based on the description below. The menu and actions below should loop (using a while loop) until the user chooses the "Done" option. Deposit: Ask the user for the amount deposited. The value must be between S0.01 and s5,000.00. If the value is acceptable, add it to the current balance and display the new balance formatted to two decimal digits and with a currency symbol (S), otherwise print a message indicating that an invalid amount has been entered. Withdrawal: Ask the user for the amount to be withdrawn. The value must be a positive number, a multiple of 10, and less than or equal to the balance. For example, a valid withdrawal for a balance of S500 would be 20 70 or 500. An invalid withdrawal for a balance of $500 would be 15, -20, 700 or 0. If the value is acceptable, subtract it from the balance and display the new balance formatted to two decimal digits; otherwise print a message indicating the problem. The message should read either amount not a positive number, amount not a multiple of 10, or insufficient funds depending on the problem. Do not worry about the amount that falls into more than one category. For instance, for an input amount of -23 your error message would just state that the amount is not a positive number. Even though -23 is also not a multiple of 10, you do not need to print that message (but can if you would prefer). Balance: Just print the balance, formatted to two decimal digits and with a currency symbol (S) in front of the value. Done: Print a farewell message and exit the program. Otherwi: Indicate that a valid choice has not been entered. Print a farewell message and exit the program. To gain some addition (G.e. D, W ,B, X) using awitch statement. You may use if-else statements within the individual cases if you would like. practice, create two versions of your above program. One will model your menu options only if-else statements. One will model your menu options (i.e. D, W ,B, X) using a

Explanation / Answer

here is your program : --------------->>>>>>>>>>>>>>>>>>>>

#include<iostream>

using namespace std;

void deposit(double &balance){
double depo = 0.0;
cout<<" Enter the Amount to be deposit : ";
cin>>depo;
while(depo < 0.01 || depo > 5000.00){
  cout<<" Enter Amount in Between ($0.01 - $5000)";
  cin>>depo;
}
balance = balance + depo;
printBalance(balance);
}

void withdraw(double &balance){
int depo = 0.0;
cout<<" Enter the Amount to be Withdraw : ";
cin>>depo;
if(depo < 0){
  cout<<" Amount not a positive number ";
}else if((depo%10) != 0){
  cout<<" Amount not a multiple of 10";
}else if(depo > balance){
  cout<<" Insufficient Fund ";
}else{
  balance = balance - depo;
  printBalance(balance);
}
}

void printBalance(double balance){
printf("Balance : %0.2f",balance);
}

void done(){
cout<<" Thanks For Using Oiler ATM have a Great day ";
exit(0);
}

void Menu(){
system("cls");
cout<<"************ OILER BANKING *************** ";
cout<<" [D] Deposit [W] Withdraw [B] Balance [X] Done ";
cout<<"****************************************** Enter Character in Brackets : ";
}

int main(){
double balance = 1000.00;
char choice = 'B';

while(choice != 'X'){
  Menu();
  cin>>choice;
  switch(choice){
   case 'D':deposit(balance);break;
   case 'W':withdraw(balance);break;
   case 'B':printBalance(balance);break;
   case 'X':done();break;
   default:choice = 'X';done();
  }
  
  cin.get();
  cin.ignore();
}

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote