Question: Write a program in C that asks the user to choose his or her favorite ice cream flavor from a list of choices, which includes

Write a program in C that asks the user to choose his or her favorite ice cream flavor from a list of choices, which includes chocolate, vanilla, and strawberry.

Requirements:

Need to include 2 functions in this program: fgets() and sscanf()

1). If some choice other than what your list shows is entered, your program should display, Sorry, we dont carry that flavor. (Hint: what decision structure is good for multiple choices?)

2). If chocolate is chosen, then your program should determine which type, Double-Dark or Chocolate Fudge

3). After the selection is made, the program prints out the name of the flavor chosen and a message: name_of_flavor chosen. Good choice!

Verify that your program works properly. Document your test cases

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!