subject

Program 9 BOX - Complete the following code then run it - Produce the correct output and Turn it in for credit - Note: A Box is a 3D object.. Write a class for a BOX (box is another name for a cube) It should contain: Width, Height, and Depth It should contain 3 methods to input/get the Width, Height, and Depth Values. It should contain a method to calculate the Volume of the box. It should contain a method to calculate sum of the Area the 6 sides of the box,. It should contain three method to return the individual values of the Width, Height and Depth variables in the class It should contain two constructor functions: a default and parameterized constructor function. The default constructor should assign the width, height and depth private variables to zero. All dimensions must be greater then zero, before the area or volume can be calculate... the calc functions should cout an error message if they are not. (The error message is a 'cout' statement) Test the box with the following driver code: HINT: Use function names and class name found in driver below. int main() { // Box 1 - Test Parameterized constructor, area of sides and volume functions box B1(1,2,3); // HINT MAKE a Parameterized constructor... cout << "Width << B1.getWidth << endl; cout << "Area ="<< B1.calcAreal) << endl; cout << "Volume="<< B1.calcVolume() << endl; // Box 2 - Test set functions, Volume, getHeight and area functions box B2; // HINT MAKE A Default constructor or set functions... B2.setWidth(2); B2.setHeight(3); B2.setDepth(4); cout << "Height="<< B2.getHeight << endl; cout << "Area = " << B2.calcAreal) << endl; cout << "Volume="<< B2.calcVolume() << endl; // Box 3 - Test zero value error for calc Area and Volume of sides functions box B3; B3.setWidth(3); B3.setHeight(4); cout << "Depth="<< B3.getDepth << endl; cout << "Area = " << B3.calcArea() << endl; cout << "Volume="<< B3.calcVolume() << endl; }

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:40, debo4965
Amain idea is supported, explained, or expanded on with a numbers b. a concluding statement c. details d. a topic sentence. im e paragraphs reset nex next
Answers: 2
image
Computers and Technology, 22.06.2019 18:30, Liantic8738
List the five on-board vehicle subsystems
Answers: 1
image
Computers and Technology, 22.06.2019 19:30, keke6361
When using a public computer or network, you should always
Answers: 2
image
Computers and Technology, 23.06.2019 01:20, shiann2002
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
You know the right answer?
Program 9 BOX - Complete the following code then run it - Produce the correct output and Turn it in...

Questions in other subjects: