You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.2 KiB
66 lines
1.2 KiB
#include "CustomerMenu.h"
|
|
|
|
void customerChoiceForMenuItem(int numberOfMenuItem)
|
|
{
|
|
switch(numberOfMenuItem){
|
|
case 1:
|
|
printf("You have chosen to send money.\n");
|
|
//call sendMoney();
|
|
break;
|
|
case 2:
|
|
printf("You have chosen to withdraw money.\n");
|
|
//call withDrawMoney();
|
|
break;
|
|
case 3:
|
|
printf("You have chosen to deposit money.\n");
|
|
//call depositMoney();
|
|
break;
|
|
case 4:
|
|
printf("You have chosen to request a loan.\n");
|
|
//call requestLoan();
|
|
break;
|
|
default:
|
|
printf("Invalid input.\n",numberOfMenuItem);
|
|
}
|
|
}
|
|
|
|
void showAllMenuEntries()
|
|
{
|
|
|
|
int userDecision = 0;
|
|
|
|
puts("\n\n");
|
|
puts("CUSTOMER MENU");
|
|
|
|
puts("\n");
|
|
printf("Select between (1-4):");
|
|
puts("\n\n\n");
|
|
|
|
printf("->->->1. send money<-<-<-");
|
|
puts("\n\n\n");
|
|
|
|
printf("->->->2. withdraw money<-<-<-");
|
|
puts("\n\n\n");
|
|
|
|
printf("->->->3. deposit money<-<-<-");
|
|
puts("\n\n\n");
|
|
|
|
printf("->->->4. request loan<-<-<-");
|
|
puts("\n\n\n");
|
|
|
|
puts("Your decision: ");
|
|
scanf("%d",&userDecision);
|
|
customerChoiceForMenuItem(userDecision);
|
|
}
|
|
|
|
void menu(customer_t *c)
|
|
{
|
|
if(c==NULL){
|
|
puts("Invalid pointer. Aborting.\n");
|
|
exit(-1);
|
|
}else{
|
|
printf("Welcome %s %s!\n",c->forename, c->surname);
|
|
printf("Balance: %.4f€\n",c->balance);
|
|
showAllMenuEntries();
|
|
}
|
|
}
|