From dd1d923a686ec02867c184f2ada6ec85764bea01 Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Sun, 22 Jan 2023 08:55:16 +0100 Subject: [PATCH] Implementation of function showAllMenuEntries() --- src/CustomerMenu.c | 31 ++++++++++++++++++++++++++++++- src/CustomerMenu.h | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/CustomerMenu.c b/src/CustomerMenu.c index 423bec6..78a067a 100644 --- a/src/CustomerMenu.c +++ b/src/CustomerMenu.c @@ -20,6 +20,35 @@ void customerChoiceForMenuItem(int numberOfMenuItem) //call requestLoan(); break; default: - printf("No item for number %d.\n",numberOfMenuItem); + printf("Invalid input.\n",numberOfMenuItem); } } + +void showAllMenuEntries() +{ + + int userDecision = 0; + + puts("\n\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); +} diff --git a/src/CustomerMenu.h b/src/CustomerMenu.h index fd3110b..5839a26 100644 --- a/src/CustomerMenu.h +++ b/src/CustomerMenu.h @@ -1,2 +1,3 @@ #include void customerChoiceForMenuItem(int); +void showAllMenuEntries();