I'm suppose to create a program for a commercial bank.
The program should start with the following menu:
Press 1. To add new customer
2. To carry out a transaction
3. To exit
If the user selects 1 the program should ask for name, address, telephone number and the amount depositing.
If the user selects 2 he is given another menu.
Press 1. For Withdrawal
2.For Deposit
3. For Enquiry
If the user selects 1 which is withdrawal, he/she should ask the user for their customer no. and the amount to withdraw.
If the user select 2 which is deposit ask the user for customer
number and the amount to deposit.
If the user selects 3 ask for the customer number and print the customers balance.
After each transaction print the users balance.
This is what i have so far:
c Code:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int gun;
int cat;
int potion;
int hate;
int dagger;
int wow;
int token;
char name[100];
char address[100];
int tagger;
int myarray[7];
void menu_option() {
printf("\n Welcome to Saleem's Commercial Bank");
printf("\n Press 1 if you are a new customer\n Press 2 if you want to carry out a transaction\n");
printf("\n Press 3 to exit the system");
scanf("%d",&dagger);
}
void option_two(){
switch(wow)
{
case 1:
printf("\n Please enter your customer number");
scanf("%d",&potion);
printf("\n Please enter the amount you are withdrawing");
scanf("%d",&cat);
break;
case 2:
printf("\n Please enter your customer number");
scanf("%d",&gun);
printf("\n Please enter the amount your depositing");
scanf("%d",&hate);
break;
default:("\n Please try again");
}
}
int main()
{
menu_option();
struct customer_information
{
char name[100];
char address[200];
int token;
};
switch(dagger)
{
struct customer_information person1;
{
case 1:
printf("Please enter your name\n");
scanf("%s",name);
printf("Please enter your address\n");
scanf("%s",&address);
printf("Please enter your telephone number\n");
scanf("%d",&token);
printf("Please enter the amount your depositing\n");
scanf("%d",&tagger);
break;
};
case 2:
printf("\n Please select the suitable option");
printf("\n Press 1 for withdrawal\n Press 2 for deposit\n");
scanf("%d",&wow);
break;
case 3:
printf("\n Thank You for using Saleem's Commercial Bank");
break;
default:
printf("\n The number you pressed is invalid. Please try again");
menu_option();
}
option_two();
return 0;
}
I am having problems with assigning customer numbers and also
in printing the balances.