Create a banking application
The application starts with a welcome message "Welcome to Standard Bank"
The user is then prompted to enter their pin
The user is given 3 chances to enter the pin correctly.
If unsuccessfull on all chances, the program exits with a message "Bye"
If password is entered successfully. The user is shown their initial balance.
A menu is then displayed with the 4 options
==== M E N U =====
 1: View balance
2: Deposit money
3: Withdraw
4: Exit
A user is then prompted to "Please enter your option"
When option 1 is selected - the balance is displayed, and the menu is shown again
When option 2 is selected - the user is prompted to enter the amount they wish to deposit. The amount entered is added to balance, and the menu is shown again
When option 3 is selected and the menu is shown again - the user is prompted to enter the amount they wish to witdraw. The amount entered is deducted from balance. If amount entered is greater than the balance, the user is informed that they have insufficient funds to make that transaction. The menu is shown again
When option 4 is selected - the program exits with a message "You have selected to exit the program. Bye..."
What I have tried:
void main()
{
while (pin != 2025) // Using while loop to check for the condition on a pin number matching
{
printf("Type your secret pin number:");
scanf("%d", &pin);
if (pin != 2025) // Checking if the pin number types by the user is matched with the database record or not
printf("Please insert your valid password:\n");
}
do
{
printf("Hello! Welcome to our ATM Service\n");
printf("1. Balance Checking\n");
printf("2. Cash Withdrawal\n");
printf("3.Cash Deposition\n");
printf("4. Exit\n");
printf("*******?********?*\n\n");
printf("Please proceed with your choice: ");
scanf("%d", &choice);
switch (choice)
{