The code I developed is as follows: #define _CRT_SECURE_NO_WARNINGS #include int main(void) {
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
You are a financial analyt in an investment advisory firm and you are helping your client to evaluate the value of a potential M&A target, WWG, inc. You estimate that WWG's enterprise value is $457.6...
-
The AND function can be realized by using only n number of NOR gates. The value of nequal to
-
What is the internal rate of return for a project that has a net investment of $75,000 and the following net cash flows: Year 1 = $15,000; Year 2 = $20,000; Year 3 = $25,000; Year 4 = $30,000?
-
As a result of increased tensions in the Middle East, oil production is down by 1.21 million barrels per daya 5 percent reduction in the worlds supply of crude oil. Explain the likely impact of this...
-
Figure P8.43 shows two blocks, one of which is placed on a low-friction table, and supports, by means of a massless rope that runs over a low-friction pulley, the other block, which is suspended in...
-
1. You should develop an Excel optimization model to find the optimal strategy. This strategy should specify the number of each type of ac-count (0-due, 1-due, 2-due, 3-due) that should receive each...
-
Write one page about pipelining in smartphones that support Android operating systems. (10 marks)
-
In the Law of Diffusion of Innovation, what role do the innovators and early adapters play in the success of a company?
-
With the sieve of Eratosthenes being used to find and count prime numbers. Describe how sieve methods are used in number theory. What kind of results have been established using such methods?
-
In constructing the Sieve of Eratosthenes for 2 through 100, it was said that any composite in that range had to be a multiple of some prime less than or equal to 7 (since the next prime, 11, is...
-
What are the basic dynamics of probabilities?
-
Francis Company sold merchandise on account for $10,700, terms 1/10, n/30. Freight charges of $260 were prepaid by Francis Company and added to the invoice. The customer returned $850 of merchandise...
-
A virtual image 65.0 cm tall is produced 40.0 cm behind a concave mirror. If the focal length of the mirror is 60.0 cm, what is the height of the object that produces the image?
-
Is light a particles or waves? EXPALIN IN DETAIL
-
Write a program that initializes an array. It inputs a value from the user and searches the number in the array.
-
In Listing 6.10, what advantage would there be in using character labels, such as a and c, instead of numbers for the menu choices and switch cases? Here is a sample run of the executive menu program...
-
What is the variable type for each of the following declarations? a. auto cars = 15; b. auto iou = 150.37f; c. auto level = 'B'; d. auto crat = U'/U00002155'; e. auto fract = 8.25f/2.5;
-
Why is cout able to display various C++ types without being provided explicit instructions for each type?
-
Alma, Inc., manufactures high-pressure cleaners for large transportation companies. It uses standard costing and allocates variable and fixed manufacturing overhead based on machine-hours. For each...
-
Michael Roberts is a cost accountant and business analyst for Darby Design Company (DDC), which manufactures expensive brass doorknobs. DDC uses two direct-cost categories: direct materials and...
-
Omegas Fleet Feet, Inc., produces dance shoes for stores all over the world. While the pairs of shoes are boxed individually, they are crated and shipped in batches. The shipping department records...
Study smarter with the SolutionInn App