Answer to Question #265914 in C++ for DANISH

Question #265914

(Only use if-else and nested if else in program)


Write a program which asks the user to open a bank account either Current or Savings. Your program will


display the following menu at the start:




Press 1 for Current Account


Press 2 for Savings Account



On the selection of account type, the user will open an account by providing an initial amount. In current account the initial amount for opening an account would be 2000 and for savings it would be 5000. After choosing the account type and opening the account with initial amount, your program will display the


following menu:




Press a for Deposit the money


Press b for withdrawing the money



In current account the user cannot withdraw more than 10000 rupees. In Savings account the user cannot withdraw more than 25000. When the user withdraws amount make sure that amount should not be more than the balance in account and at the end of withdrawal transaction, there should be


minimum of 500 rupees for each account.

1
Expert's answer
2021-11-14T17:02:39-0500
#include <iostream>

using namespace std;

int main(void) 
{
  int current = 0,
      saving = 0;
  printf("Press 1 for Current Account\n"
         "Press 2 for Savings Account\n");

  int choice;
  scanf("%d", &choise);
  
  if (choise == 1) 
    current = 2000;
  if (choise == 2)
    saving = 5000;
  
  printf("Press a for Deposit the money\n"
         "Press b for withdrawing the money\n");
  
  char c;
  scanf("%d", &c);

  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS