Question: Problem 1.1. Initial Design, Implementation and Testing - complete all steps below; Test your program with data in Testing and with one more set of

Problem 1.1. Initial Design, Implementation and Testing - complete all steps below; Test your program with data in Testing and with one more set of different data. Submit .cpp file and the 2 outputs. Include reasonable number of comments. (max 20 points) INITIAL ALGORITHM 1. Get the washer's inner diameter, outer diameter, and thickness. 2. Get the material density and quantity of washers manufactured. 3. Compute the rim area. 4. Compute the weight of one flat washer. 5. Compute the weight of the batch of washers. 6. Display the weight of the batch of washers. ALGORITHM REFINEMENTS Step 3 Refinement 3.1 Compute holeRadius and edgeRadius. 3.2 rimArea is PI * edgeRadius * edgeRadius PI * holeRadius * holeRadius Step 4 Refinement 4.1 unitWeight is rimArea * thickness * density IMPLEMENTATION To write this program, edit the data requirements to write the variable dec- larations and use the initial algorithm with refinements as a starting point for the executable statements. Listing 3.4 shows the C++ program. TESTING To test this program, run it with inner and outer diameters such as 2 centimeters and 4 centimeters that lead to easy calculations for rim area (3 * PI square cen- timeters). You can verify that the program is computing the correct unit weight by entering 1 for quantity, and then verify that the batch weight is correct by running it for larger quantities. Your First Output: Inner diameter in centimeters: 1.2 Outer diameter in centimeters: 2.4 Thickness in centimeters: 0.1 Material density in grams per cubic centimeter: 7.87 Quantity in batch: 1000 The expected weight of the batch is 2670.23 grams
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
