Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The code I developed is as follows: #define _CRT_SECURE_NO_WARNINGS #include int main(void) { char coffeeType1, coffeeType2, coffeeType3, creamServed1, creamServed2, creamServed3,
3. 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 4. 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). 5. 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 name to maximize readability and maintainability of the code 6. 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", ... 7. 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: printf("1 | %d I %d I %d | %4d | $6.31f | %d | ", 8. The below table provides the mapping rules you must apply in matching the customer input preferences to each product (Example: if the user prefers "Light" coffee, and the product type is "Light" this would show as true (1) in the summary table result): Customer Preference Coffee Strength (I or L) (m or M) (r or R) Daily Servings (inclusive range) Light Medium Rich 1 to 4 5 to 9 10 or more Like Groom with Coffee Coffee Type (1 or L) (m or M) (r or R) Coffee Package Weight Light Medium Rich Product 250 g 500 g 1000 g Support Sending with Gramm
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