Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 2 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 14 Sep 2017 My Price 9.00

smoke ventilation system

C++ programming problem

The class Chimney represents a smoke ventilation system. Consider the class diagram shown below.
Each instance of a Chimney has a height, a shape and can be either opened or closed. Here is the class definition (.h)

Class Diagram Class Definition (.h file)
Chimney
Chimney( );
void open();
void close();
bool isOpen() const;
void setHeight( double height );
double getHeight() const;
bool isOpen;
double myHeight; // in feet
class Chimney {
public:

Chimney( );
void open();
void close();
bool isOpen() const;
void setHeight( double height );
double getHeight() const;

private:

bool isOpen;
double myHeight;

};


Based on the information shown here, a possible implementation (.cpp) for Chimney is shown below.

Chimney::Chimney( ) {

isOpen = false;
myHeight = 0;

}

void Chimney::open() {

isOpen = true;

}

void Chimney::close() {

isOpen = false;

}

bool Chimney::isOpen() const {

return( isOpen );

}

void Chimney::setHeight( double height ){

myHeight = height;

}

double Chimney::getHeight() const {

return( myHeight );

}


Based on this implementation of Chimney, define and implement the class Fireplace (a .h file and a .cpp
file). A Fireplace can be lit or extinguished and always has a Chimney to ventilate the smoke away. The
relationship between Fireplace and Chimney is shown in the diagram below.

Fireplace Class Diagram
Make sure your definition of Fireplace supports the following kinds of constructors:

Chimney Image Fireplace warmFire; By default, a lighted fireplace with an open chimneystack that has a height 10 feet
Chimney Image Fireplace noFire( 20, false ); An unlit fireplace with a closed chimneystack that has a height of 20 feet


In addition, create these two operations on Fireplace :

(1)void Fireplace::light();
(2)void Fireplace::extinguish();

These operations should adjust the Fireplace by manipulating the Chimney, opening the chimneystack
before the FireplaceA????1s fire is lit and closing the chimneystack after the fire is extinguished.

As currently defined, can any of the member operations you defined on the class Fireplace be marked const?

Answers

(5)
Status NEW Posted 14 Sep 2017 07:09 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)