Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part - 2 ( 4 0 % ) Instructions Carefully review the Part - 2 Output Example ( next section ) to see how this

Part-2(40%)
Instructions
Carefully review the "Part-2 Output Example" (next section) to see how this program is expected to work
Code your solution to Part-2 in the provided "w3p2.c" 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 (3) products and store user-input 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 (2 times): Prompt for the user's coffee preferences and store user-inputs to
appropriate variables
e) Display summary of results: Apply the customer-input 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 "GRAMS_IN_LBS" 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 (9) variables used to represent the three (3)
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 self-describing variable names to maximize readability and maintainability of the code
Prompting user-input for a single-character 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 double-quotes) to
avoid strange behaviour (notably the single-space before the percent sign):
scanf("%c",...
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 w3p2.c file that will look like the below:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

Students also viewed these Databases questions