Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.2 c++ Problem 1.1. Initial Design, Implementation and Testing - complete all steps below; Test your program with data in Testing and with one more
1.2 c++
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. Problem 1.2 Modify your code by replacing part of the code with 2-3 functions. Test the modified program with data you used before. Submit .cpp modified file and the 2 outputs. Include reasonable number of comments. (max 30 points)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