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, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
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, 30.04.2021 19:30
Questions on the website: 13722360