From e30f7a66ae355d3ee391bb7f0f614e87520e30b9 Mon Sep 17 00:00:00 2001 From: fdai7207 Date: Thu, 26 Jan 2023 17:39:22 +0100 Subject: [PATCH] implement the main menu --- src/.mainMenu.c.swp | Bin 0 -> 12288 bytes src/mainMenu.c | 93 ++++++++++++++++++++++++++++++ src/mainMenu.h | 15 +++++ src/run_BankManagementSimulator | Bin 0 -> 16344 bytes src/run_BankManagementSimulator.c | 8 +++ 5 files changed, 116 insertions(+) create mode 100644 src/.mainMenu.c.swp create mode 100644 src/mainMenu.c create mode 100644 src/mainMenu.h create mode 100755 src/run_BankManagementSimulator create mode 100644 src/run_BankManagementSimulator.c diff --git a/src/.mainMenu.c.swp b/src/.mainMenu.c.swp new file mode 100644 index 0000000000000000000000000000000000000000..450d36d58813421c426ec69c21ace50d51d98f20 GIT binary patch literal 12288 zcmeI2&2Jk;7>6f(NEAqm;82dQUE11-lQ`j0C2}N+day*KicdkE((!uMUUhfI+MP{m zlE4870&xWi1QI7CI8lTUT;K?z5)v2wf+AW@J@s0CGrQYvYLb*=q*?3nYBTS?^UgCf zQld<^`Eq-OPR%YbT#qsKzi4^xh|I% zBQAMgL_+GBWRz$T%_Xrn7x6&auN5KFS#RHrF2EUZ2JYR!Bzt;czG>o*RV(zw<1gL& zt1i+Ra0Z+KXTTY72AlzBz!`7`4!i+9oM3NZ6!+yLS?u06`wU*IZu z4{U=?um(~P0v`y_0Mp<&cnVZO1rRs_4ud}*ffuj@Zo>6lqVtHAhw4Y> zdd#nx<>ypCki-+>lFmfKP>qC`-LJnpuRkyP0gk4|HUmkqPM%718j1M7lb8XP%FYt) ztU_Eu#z6M}U#7F6;EABbY9l2DDWCK}kgvi}t($y)Dy`9^GB&Uw3DSyA z;~*}r*ps-ieUGiFphw9-t(yb5wfY8@Up|fbt+12bi@6QtFx3>uH68}N3h8)6ypOZI zm2AS8iQcf^B1}ZKF1GBmY1uRNt12}GrD2b{g19E*Leu;y8VMdJq|kt&c(LFb?PLxY z6ZbrYv&%*Ihc?(D(=i2p4X2LJiZ}|A1nbW{)mts{Ia=$x6?DhPQdYVt+FZr(pYc4A zB-D?&)S`!8vyYhxbZtZNwOi*pPSN-6FqA|sN_4DMShHdqC+zL@p~6lQabv!jZ<#E2 z;8V>T2=8LsZ==00;_S6LVPqyb<=GRDOKimBNwr}Uj%~bRoehN-_#+yr6l)*lERq?D ztuRzrZ1`FJ=nZ&0g^9=X7v*KU*)(K7Key0aMYLU6c(H9_?aIm)Kxy)0q0?B}lJoTA zYv#75JlM|Mj%cGp$X-#7kznhi%}tsrH&j}5veP_S$SDh_6Q#fgS>d*4JFIdRblp`d zq`M}d= 18) + { + + return true; + + } + + else + { + + return false; + + } + +} + +bool checkIfInteger(char* input){ + + char *end_pointer; + + strtol(input, &end_pointer, 10); + + if (end_pointer == input || *end_pointer != '\0') + { + + return false; + + } + + else + { + + return true; + + } +} + +void ageInput(){ + + char input[20]; + char* input_pointer; + + long age; + + printf("\nPlease specify your age : "); + scanf("%s",input); + + if (checkIfInteger(input) == true ) + { + age = strtol(input,&input_pointer,10); + + if(agePermission(age)== true) + { + printf("Access granted!\n\n\n\n"); + + showMenu(); + + } + else if(agePermission(age)== false) + { + + printf("You should be at least 18 years old to create a bank account!\n"); + + } + } + + else + { + + printf("input invalid! try again!\n"); + + } + +} + + +void showMenu(){ + + printf("\t\t\t\t\t\t\t Welcome to Bank Manager!"); + printf("\n\n\n\n\t\t\t\t\t\tPlease select one of the following functions!"); + printf("\n\n\n\n\t\t\t\t\t\t ->Login as an existing costumer."); + printf("\n\n\t\t\t\t\t\t ->Register as a new costumer."); + printf("\n\n\t\t\t\t\t\t ->Login as an Employee."); + printf("\n\n\t\t\t\t\t\t\t\t ->Exit.\n"); + printf("\n\n\n\n\n Selection :\n"); + +} diff --git a/src/mainMenu.h b/src/mainMenu.h new file mode 100644 index 0000000..f62dda9 --- /dev/null +++ b/src/mainMenu.h @@ -0,0 +1,15 @@ +#ifndef MAINMENU_H_ +#define MAINMENU_H_ + +#include +#include +#include +#include + +void showMenu(); +void ageInput(); + +bool agePermission(int age); +bool checkIfInteger(char* input); + +#endif diff --git a/src/run_BankManagementSimulator b/src/run_BankManagementSimulator new file mode 100755 index 0000000000000000000000000000000000000000..44db5061d4cff47e5bd7164e534851c4e0a7d1b9 GIT binary patch literal 16344 zcmeHOeQXrR6(1WM3;}EsNDL%lNkf&C`mn(vKns|UgL4YR1(PUM$!2}G=i73(>)!1J zJ1vCPq>4*W$v-Wssw(-1q-t8xDvfBRs!nJLNJ$Ec6cP19?nhLkeAIE9mZX8}@6F6x z)|+$FR{5h+cci^H@Ap3D&D+_%+1;53l3O;_*3<|tlf)W9+;F2p+O?o*g|2|Kixpx9 zeiw)v#1-HtOH9ez6@gThbG74Xy~Zbjl3f#3s?h5cESPeHM9FTV(m6#*m&fVOEnreQnE&5>rMe`NJ|+NblfUsJXtmh7I;c28(KrlS-P z3RBJ}<%EtEI-V$PAtMx~QM;VBi_(qCOfaQ3sO)&v&-^#-b!xj~3zeTJ?NYE{%I$p` zc9fTYxA1A+uG^dFJmhr#nd=70a8Kws)g5^9ur>74>q&>=CL7YB zLjHJ&5Kr}KI7mn3<4dS1jObbW#RAcZ3i-dPitwwzj4Jpoz^dufu&jn}n*cuw+`thn zHv*{UCouv3Bj5&(XsH1}zTQ_%Gu>yIS;w{V&i%G9O`O=YS@Nx-Zx$@a6(zsudwJ1Y z_DhgDB`>{lrCCZ_ZWb)`(!0%cZnv4W94HkX*Ut)aK|^7=*u14<{RVSs;xR7N+Fe$6o}%h0c&?7hRH{`K(Y;!n`$@RgCrMf- ze`!2S7Bpgb++XWBGiY?08k;To$->cmd7d+sMpsGmPd)N=45wQ00C*~VzvBDE&@6>N zs_#dP@7H*JyOJ}`{JFIXr?E=sh|6#Y50CGW5U$3zvKS5F2s|hkLO5L)T#jj+{toz> zB-!y0PS+ckp%5b|1^Y?wgr?9xE%k4GmdGuaQiG$ZXWm?!dgj8URL#lM*-QRx zICxMysILrXWt?nJ`P;vm#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