Question: Please solve using c++ Write a program that reads in the original width (y) and length (z) of a sheet of cardboard and prints out

Please solve using c++ Write a program that reads in the originalPlease solve using c++

Write a program that reads in the original width (y) and length (z) of a sheet of cardboard and prints out for every possible integer height (x), the volume of the resulting box and how many square inches of cardboard are wasted by the cutouts. Sample run: Enter sheet width: 101 Enter sheet length: 8 Possible boxes: Height Width Length Volume Waste Area 1 8 6 48 4 2 6 4 48 16 3 4 2 24 3 is the maximum height we can make with a 10x8 sheet. Here is a visual representation of how the functions relate to each other in the final program. Note that some functions will need to be called more than once. main Give prompt Gets user input Give width, length Get max height Give width, length, height Get Volume Give cutoutSize Get waste area getInteger getMax Height getVolume getWastes Give width, length Get Area getArea To detect bad console input and get rid of it until the user enters something useful you need to do something like: int x; cout > x; //if cin reports a failure, start this loop while (cin.fail()) { cin.clear(); //clear any errors so cin starts working cin.ignore (INT_MAX, ' '); //get rid of any existing (bad) input cout > x; //try again cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!