Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part - 2 ( 4 0 % ) Instructions Carefully review the Part - 2 Output Example ( next section ) to see how this
Part
Instructions
Carefully review the "Part Output Example" next section to see how this program is expected to work
Code your solution to Part in the provided wpc source code file
This program can be broken down into a few major logical code sections:
a Variable declarations: All variables should be declared together into meaningful groups at the top of the main
function
b Product data input: Prompt for data describing three products and store userinput to appropriate variables
c Display product data: Summarize the product data in a tabular format to help make the data easy to read
d Customer preference input times: Prompt for the user's coffee preferences and store userinputs to
appropriate variables
e Display summary of results: Apply the customerinput preferences; match how each product meets the needs
of the customer defined preferences
f Repeat: Repeat step d and e for another preference scenario
Don't delete or modify the provided "GRAMSINLBS variable declaration you will need this in the conversion
from grams to pounds when appropriate
Using the example output as a guide, declare the necessary nine variables used to represent the three
product data "records".
Note
You must select the appropriate data type for each variable based on the type of data that needs to be stored
You must use selfdescribing variable names to maximize readability and maintainability of the code
Prompting userinput for a singlecharacter value can cause unexpected behaviour which you will learn about later
in the semester, however, for now use the following scanf formatting specifier between the doublequotes to
avoid strange behaviour notably the singlespace before the percent sign:
scanfc
Displaying the product data in a tabular format requires the application of some slightly more advanced formatting
features you will learn more about this later in the semester For now, use the printf statement provided as a
comment in the supplied starter wpc file that will look like the below:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started