Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a c++ program that - defines the class Cuboid which has the following: - default constructor (has no parameters) - constructor that has 3

Write a c++ program that

- defines the class Cuboid which has the following:

- default constructor (has no parameters)

- constructor that has 3 parameters (height, length, width)

- data members

- height, length, width

- member functions

- to set the value of each of the data members - 3 functions

- to get the value of each of the data members - 3 functions

- one that returns the volume

- one that returns the surface area

- one that increases each dimension by a specified factor

(Function definitions outside of the class!!!)

- in main()

- instantiate a Cuboid object and initialize at the time of definition

- make sure the constructor with parameters is called

- define an array of 2 Cuboid objects

- using a loop get information to populate the 2 objects in the array

- prompt for the height, length, and width

- prompt for a size by which to increase each dimension (one input)

- call a global function passing a Cuboid object and the increase

factor as separate arguments; function will call the class member

function to increase the dimensions; parameters of the function

should be references

- display the dimensions , the volume, and the surface area for each of

the three objects

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

2 Classify common stocks according to their major characteristics.

Answered: 1 week ago