Question
The following files starts with some comments that describe the problem comments are lines that begin with two slashes(//). following the comments the file contains pseudocode that has one or more bugs you must find and correct
Class Class 12. Debug (5 points) The following file starts with some comments that describe the prolblemcnpseudocode lines th
Class Class string highestId string higestDescrip while x<SIZE productSISIZE)-get Data total total productstx if products(x)-
Class Class 12. Debug (5 points) The following file starts with some comments that describe the prolblemcnpseudocode lines that begin with two slashes Un). Following the comments, the file that has one or more bugs you must find and correct. This Eile defines the Building class // and the Hotel class that inherits from it classatrat ion program declares and uses a Hotel object class Building private string streetAddress private nun squareFeet public string getAddress return streetAddress public void get SquareFeet return squareFt publie void setsquareFeeto squareFeet -feet return public void setstreetAddress (string address) address-streetAddress return endClass class Hotel inheritsFrom Building Declarations private num numberofRooms public Hotel (string address, num sqFt, num rooms) streetAddress address squareFeetsqFt numberofRooms rooms return public num getNumberof Rooms return rooms endClass start Declarations Hotel hotel ("100 Main Street", 8000, 20) output getAddress), getSquareFeet ), get NumberOfRooms ) stop Page 20 of 24
Class Class string highestId string higestDescrip while x
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The code goes here:

#include<bits/stdc++.h>
using namespace std;

class Building
{
string streetAddress;
int squareFeet;

public:
string getAddress()
{
return streetAddress;
}

int getSquareFeet()
{
return squareFeet;
}

void setSquareFeet(int Feet)
{
squareFeet=Feet;
}

void setStreetAddress(string address)
{
streetAddress=address;
}
};

class Hotel:public Building
{
int numberOfRooms;

public:
void hotel(string address,int sqFt,int rooms)
{
setSquareFeet(sqFt);
setStreetAddress(address);
numberOfRooms=rooms;
}

int getNumberOfRooms()
{
return numberOfRooms;
}
};


int main()
{
Hotel ob;
ob.hotel("100 Main Street",8000,20);
cout<<"The entered address is....... "<<ob.getAddress()<<endl;
cout<<"The entered square Feet is.... "<<ob.getSquareFeet()<<endl;
cout<<"The entered no of rooms is.... "<<ob.getNumberOfRooms()<<endl;
}

The output goes here:

CUsers sauravDocuments\ Untitled1.exe The entered address is.......100 Main Street The entered square Feet is.... 8000 The en

The 2nd question isn't a complete one i believe.

Please do comment for further queries........

Hope it helps :)

Add a comment
Know the answer?
Add Answer to:
The following files starts with some comments that describe the problem comments are lines that begin with two slashes(//). following the comments the file contains pseudocode that has one or more bu...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT