Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Build and test functions for a program that calculates information about the boxes that can be made from a sheet of cardboard. Say we have

image text in transcribed

Build and test functions for a program that calculates information about the boxes that can be made from a sheet of cardboard. Say we have a sheet of cardboard that has a width of y and a length of z. We can make cuts of size x, then fold the sides up to make a box with the dimensions y - 2x by z - 2x by x

Please help with c++

C++ Function Building functions described below are implemented and working. Each function needs at least one test. Many will require more than one. For example, you should make sure the getMax Height function works correctly with boxes that are wider than they are long and vice versa. Here is what two tests of getMaxHeight might look like: int result1 = getMaxHeight(6, 8); cout 0). int getArea(int width, int length) For a given width and length, return area of the corresponding rectangle. int getVolume(int width, int length, int height) For a given width, length and height, return volume of corresponding box. This MUST use getArea as a helper for full credit. int getWaste(int cutoutSize) For a given size cutout (x), return the total waste produced (total area cut out at the corners). getWaste(3) should return 36. C++ Function Building functions described below are implemented and working. Each function needs at least one test. Many will require more than one. For example, you should make sure the getMax Height function works correctly with boxes that are wider than they are long and vice versa. Here is what two tests of getMaxHeight might look like: int result1 = getMaxHeight(6, 8); cout 0). int getArea(int width, int length) For a given width and length, return area of the corresponding rectangle. int getVolume(int width, int length, int height) For a given width, length and height, return volume of corresponding box. This MUST use getArea as a helper for full credit. int getWaste(int cutoutSize) For a given size cutout (x), return the total waste produced (total area cut out at the corners). getWaste(3) should return 36

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions