(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.
#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;
}
Comments
Leave a comment