subject

In C coding, complete the code provided to add the appropriate amount to totalDeposit. #include

int main(void) {
enum AcceptedCoins {ADD_QUARTER, ADD_DIME, ADD_NICKEL, ADD_UNKNOWN};
int totalDeposit = 0;
int userInput;

printf("Add coin: 0 (add 25), 1 (add 10), 2 (add 5). ");
scanf("%d", &userInput);

if (userInput == ADD_QUARTER) {
totalDeposit = totalDeposit + 25;
}

/* Your solution goes here */

else {
printf("Invalid coin selection.\n");
}

printf("totalDeposit: %d\n", totalDeposit);

return 0;
}
Sorry in advance, my professor is a bit hard to understand so I'm trying to figure this out a bit still. Would like a walkthrough on it if possible.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 13:30, valeriegarcia12
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, titalili0204
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
image
Computers and Technology, 24.06.2019 09:40, anyar
Healthy study habits are best described as
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, toshahoskins0098
What are some websites that you can read manga (ex: manga rock)
Answers: 1
You know the right answer?
In C coding, complete the code provided to add the appropriate amount to totalDeposit. #include

Questions in other subjects:

Konu
Mathematics, 31.08.2019 04:40
Konu
Mathematics, 31.08.2019 04:40