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 06:20
In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server or network availability confidentiality integrity identity automated attack software? those who wrongfully disclose individually identifiable health information can be fined up to what amount per calendar year? single most expensive malicious attack hipaa what are script kiddies? advanced persistent threat security manager security engineer what level of security access should a computer user have to do their job what process describes using technology as a basis for controlling the access and usage of sensitive data? cybercriminal
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
How is the brightness of oled of the diaplay is controled
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
You know the right answer?
In C coding, complete the code provided to add the appropriate amount to totalDeposit. #include
Questions
question
Mathematics, 23.02.2021 17:50
question
Mathematics, 23.02.2021 17:50
Questions on the website: 13722363