Question: ATM Machine Code in C with given specifications: -PIN is 1234, Balance starts at $1,000 -First displays Enter PIN #. If PIN is wrong, displays

ATM Machine Code in C with given specifications:

-PIN is 1234, Balance starts at $1,000

-First displays "Enter PIN #". If PIN is wrong, displays "Entered wrong PIN" and the pin prompt is displayed again. If PIN is correct, menu is displayed.

-Menu can only withdraw, deposit or quit (need to use switch statement). If one of these is not selected a message saying "Not valid option" is displayed.

-Can only make 3 withdraws. If 4th is tried then a message saying "Too many withdraws made" will be displayed and the menu will display again. If withdraw exceeds balance, it will not happen and will display "Not enough funds!", then menu will display again.

-Unlimited deposits but total of deposits cannot exceed $10,000. Depositing more will display message "Reached max deposit limit" and the menu will be display again.

-ATM continuously runs until user quits. Quitting will display "Transactions done".

I started it below:

int pin, options, x;

int balance = 1000;

printf("Enter PIN: ");

scanf("%d", &pin);

if(pin != 1234)

{

printf("Entered Wrong PIN ");

return 0;

}

if(pin == 1234);

{

printf("Select option ");

printf("1.Withdraw ");

printf("2.Deposit ");

printf("3.Quit ");

scanf("%d", &options);

switch(options);

{

case 1:

printf("How much to withdraw ");

scanf("%d", &x");

balance -= x

printf("Balance remaining: %d ", balance)

case 2:

printf("How much to deposit ");

scanf("%d", &x");

balance += x

printf("New Balance: %d ", balance)

case 3:

printf("Transactions done.")

if(options != 1 || options != 2 || options != 3)

printf("Not valid option.")

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!