Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem: In Labs 1-3 Makeup, you were required to write 6 while loops to check input for dimensions of 3-dimensional objects. For this lab, you
Problem: In Labs 1-3 Makeup, you were required to write 6 while loops to check input for dimensions of 3-dimensional objects. For this lab, you should redo Labs 1-3 makeup with function calls replacing the while loops to check dimensions and write a function to check the validity. (I have posted a possible solution for Labs 1-3 makeup that you can use if you did not do Labs 1-3 makeup. Review this possible solution, fix any errors, then make the changes for s la The new function that you add to check the validity should accept two parameters: one a double and one a string. You should send the dimension that is being checked to the double parameter and a description of what that dimension stands for (e.g. "radius of sphere", "height of box", etc.) to the string parameter. The function should employ a single while loop to check the validity of dimension and prompt the user to re-enter the dimension when it is wrong. There should not be any selection structures in this function. Your error message should what dimension is wrong be similar to The length of the box cannot be less than zero. Please enter the length of the box again." You should only have one function other than main. Do not use and string objects to store the descriptions of the dimensions, rather send a literal constant to the function. Remember to write your function definition after main and write a function declaration (prototype) before main for your function. Write comments immediately before your new function describing the task of the function, input, output, and processing for the function. Do not use the same variable name in multiple (more than one) functions Do not use any concepts beyond Chapter 6 of your textbook! Remember your problem description in your introductory comments should be detailed enough so anyone reading it will know what the code should be doing without accessing any outside documentation. Do not skip on the details. Attach your C++ source file to the Assignment on CANVAS. Remember to confirm all vour submissions to CANVAS
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