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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
You know the right answer?
In C coding, complete the code provided to add the appropriate amount to totalDeposit. #include
Questions
question
Mathematics, 13.05.2021 18:20
question
Mathematics, 13.05.2021 18:20
question
English, 13.05.2021 18:20
question
Mathematics, 13.05.2021 18:20
question
Mathematics, 13.05.2021 18:20
Questions on the website: 13722367