Enter ice cream flavor #1: vanilla Enter ice cream flavor #2: chocolate Enter ice cream flavor #3: mint Enter ice cream flavor #4: strawberry Enter corner 1 sales of vanilla 11.5 Enter corner 1 sales of chocolate 15.75 Enter corner 1 sales of mint 22 Enter corner 1 sales of strawberry 7.25 Enter corner 2 sales of vanilla 12.75 Enter corner 2 sales of chocolate 9.25 Enter corner 2 sales of mint 16.5 Enter corner 2 sales of strawberry 21 Total vanilla sales: 24.25 Total chocolate sales: 25.00 Total mint sales: 38.50 Total strawberry sales: 28.25 Bob's Ice Cream total sales: 116.00

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter9: Formula Auditing, Data Validation, And Complex Problem Solving
Section: Chapter Questions
Problem 6AYK
icon
Related questions
Question

Bob’s Ice Cream sells four types of ice cream: vanilla, chocolate, mint, and strawberry.
• Bob's Ice Cream sells ice cream from trucks that are parked at two different corners.
They sold {$11.5, $15.75, $22, $7.25} on Saturday and {$12.75, $9.25, $16.5, $21} on
Sunday [note sales are in vanilla, chocolate, mint, and strawberry order].
• Create an enum for flavors:
enum flavors {vanilla, chocolate, mint, strawberry};
• Create a C program that allows a user to enter the type of ice cream sold.
• Create a C program that allows a user to enter the sales data.
• Load two one-dimensional arrays with Bob’s entered sales data. Only index your arrays
using an enum variable (enum flavors index = vanilla; corner1Sales[index] = 11.5;)
• Sum the contents of the flavors in the arrays together.
• Print out the resulting flavors and their sum with Bob's total sales

Note: when using fgets:
1. you'll need to make the array that holds your
string +2 in size. You have to have room for
the final /n and the final /0.
2. Your fgets max size has to account for the two
additional characters: max string size + 2.
 
 

output should be look similar to the picture, and please with comment for the code.

output sample below:

Enter ice cream flaver #1: vanilla

Enter ice cream flaver #2: chocolate

Enter ice cream flaver #3: mint

Enter ice cream flaver #4: strawberry

Enter corner 1 sales of vanilla: 22

Enter corner 1 sales of chocolate: 44

Enter corner 1 sales of mint: 66

Enter corner 1 sales of strawberry: 33

 

Enter corner 2 sales of vanilla: 33


Enter corner 2 sales of chocolate: 55

Enter corner 2 sales of mint: 22

Enter corner 2 sales of strawberry: 44


Total vanilla sales: 55.00
Total chocolate sales: 99.00
Total mint sales: 88.00
Total strawberry sales: 77.00
Bob's Ice Cream total sales: 319.00

Enter ice cream flavor #1:
vanilla
Enter ice cream flavor #2:
chocolate
Enter ice cream flavor #3:
mint
Enter ice cream flavor #4:
strawberry
Enter corner 1 sales of vanilla
11.5
Enter corner 1 sales of chocolate
15.75
Enter corner 1 sales of mint
22
Enter corner 1 sales of strawberry
7.25
Enter corner 2 sales of vanilla
12.75
Enter corner 2 sales of chocolate
9.25
Enter corner 2 sales of mint
16.5
Enter corner 2 sales of strawberry
21
Total vanilla sales: 24.25
Total chocolate sales: 25.00
Total mint sales: 38.50
Total strawberry sales: 28.25
Bob's Ice Cream total sales: 116.00
Transcribed Image Text:Enter ice cream flavor #1: vanilla Enter ice cream flavor #2: chocolate Enter ice cream flavor #3: mint Enter ice cream flavor #4: strawberry Enter corner 1 sales of vanilla 11.5 Enter corner 1 sales of chocolate 15.75 Enter corner 1 sales of mint 22 Enter corner 1 sales of strawberry 7.25 Enter corner 2 sales of vanilla 12.75 Enter corner 2 sales of chocolate 9.25 Enter corner 2 sales of mint 16.5 Enter corner 2 sales of strawberry 21 Total vanilla sales: 24.25 Total chocolate sales: 25.00 Total mint sales: 38.50 Total strawberry sales: 28.25 Bob's Ice Cream total sales: 116.00
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L