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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
You know the right answer?
Program 9 BOX - Complete the following code then run it - Produce the correct output and Turn it in...
Questions
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
question
Mathematics, 18.03.2021 03:20
Questions on the website: 13722360