Module/Week 6 Assignment (User-defined: Simple Data Types, String Types) You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order....



Module/Week 6 Assignment (User-defined: Simple Data Types, String Types)


You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. The price per board foot is given in the following table:



The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no integers following it on the line. The program should print out the price for each entry, and print the total after T is entered. Here is an example run:



Develop the program using functional decomposition, and use proper style and documentation in your code. Your program must make appropriate use of value-returning functions in solving this problem. Make sure that the user prompts are clear and that the output is labeled appropriately.



Submit C++ Programming Assignment 6 by 11:59 p.m. (ET) on Monday of Module/Week 6.




Module/Week 6 ASSIGNMENT (USER-DEFINED: SIMPLE DATA TYPES, STRING TYPES)<br>You are working for a lumber company, and your employer would like a program that calculates the cost of lumber<br>for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board<br>foot equals one square foot that is one inch thick. The price per board foot is given in the following table:<br>Pine<br>0.89<br>1.09<br>Fir<br>Cedar 2.26<br>Maple 4.50<br>Oak<br>3.10<br>The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to<br>be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is<br>equivalent to 5.333 board feet (2 *4* 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user<br>will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and<br>length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When<br>the letter is T, there are no integers following it on the line. The program should print out the price for each entry,<br>and print the total after T is entered. Here is an example run:<br>Enter item: P 10 2 4 8<br>10 2x4x8 Pine, cost: $47.47<br>Enter item: M 1 1 12 8<br>1 1x12x8 Maple, cost: $36.00<br>Enter 1tem: T<br>Total cost: $83.47<br>Develop the program using functional decomposition, and use proper style and documentation in your code. Your<br>program must make appropriate use of value-returning functions in solving this problem. Make sure that the user<br>prompts are clear and that the output is labeled appropriately<br>Submit C++ Programming Assignment 6 by 11:59 p.m. (ET) on Monday of Module/Week 6<br>

Extracted text: Module/Week 6 ASSIGNMENT (USER-DEFINED: SIMPLE DATA TYPES, STRING TYPES) You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. The price per board foot is given in the following table: Pine 0.89 1.09 Fir Cedar 2.26 Maple 4.50 Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 *4* 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no integers following it on the line. The program should print out the price for each entry, and print the total after T is entered. Here is an example run: Enter item: P 10 2 4 8 10 2x4x8 Pine, cost: $47.47 Enter item: M 1 1 12 8 1 1x12x8 Maple, cost: $36.00 Enter 1tem: T Total cost: $83.47 Develop the program using functional decomposition, and use proper style and documentation in your code. Your program must make appropriate use of value-returning functions in solving this problem. Make sure that the user prompts are clear and that the output is labeled appropriately Submit C++ Programming Assignment 6 by 11:59 p.m. (ET) on Monday of Module/Week 6

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here