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
  • Please put the following pseudocode into C++. Below the pseudocode is a header file as well...

    Please put the following pseudocode into C++. Below the pseudocode is a header file as well as a cpp file that needs to be included. // Start // Declarations // Automobile myAuto // string vin // string make // string model // string color // output "Please enter the Vehicle Identification Number: " // input vin // output "Please enter the Make: " // input make // output "Please enter the Mode: " // input model // output "Please enter...

  • This one is a little tricky for me. Please put the following pseudocode into C++. Below...

    This one is a little tricky for me. Please put the following pseudocode into C++. Below the pseudocode is a header file as well as a cpp file that needs to be included. // Start // Declarations // TermPaper paper1 // string firstName // string lastName // string subject // character grade // output "Please enter first name. " // input firstName // output "Please enter last name. " // input lastName // output "Please enter subject. " // input...

  • JAVA project PLEASE complete/ create project with comments in the programming explaining everything Text file Year...

    JAVA project PLEASE complete/ create project with comments in the programming explaining everything Text file Year of storm/ Name of storm/ mmdd storm started/ mmdd storm ended/ magnitude of storm/ //made up data 2004/Ali/1212/1219/1 2003/Bob/1123/1222/3 1980/Sarah/0123/0312/0 1956/Michael/1211/1223/4 1988/Ryan/0926/1019/ 1976/Tim/0318/1010/0 2006/Ronald/0919/1012/2 1996/Mona/0707/0723/1 2000/Kim/0101/0201/1 2001/Jim/1101/1201/3 Text file Class storm{ private String nameStorm; private int yearStorm; private int startStorm; private int endStorm; private int magStorm; public storm(String name, int year, int start, int end, int mag){ nameStorm = name; yearStorm = year; startStorm...

  • Templates Apartment.java package hwk7; public class Apartment {    int numOfApartments; // the number of apartments...

    Templates Apartment.java package hwk7; public class Apartment {    int numOfApartments; // the number of apartments of this type    Room[] rooms; // rooms in this type of apartment       Apartment(int numOfApartments, Room[] rooms) {        this.numOfApartments = numOfApartments;        this.rooms = rooms;    }       // Return the window orders for one apartment of this type as TotalOrder object    TotalOrder orderForOneUnit() {        // TODO    }       // Return the window...

  • The names of the two input files as well as the output file are supposed to be provided as arguments. Could you please fix it? Thanks. DPriorityQueue.java: // Import the required classes import java....

    The names of the two input files as well as the output file are supposed to be provided as arguments. Could you please fix it? Thanks. DPriorityQueue.java: // Import the required classes import java.io.*; import java.util.*; //Create the class public class DPriorityQueue { //Declare the private members variables. private int type1,type2; private String CostInTime[][], SVertex, DVertex; private List<String> listOfTheNodes; private Set<String> List; private List<Root> ListOfVisitedNode; private HashMap<String, Integer> minimalDistance; private HashMap<String, Integer> distOfVertices; private PriorityQueue<City> priorityQueue; // prove the definition...

  • Download BankAccount.java and BankAccountTester.java starting files and drag and drop them into your eclipse project. The...

    Download BankAccount.java and BankAccountTester.java starting files and drag and drop them into your eclipse project. The BankAccount class declaration in file BankAccount.java is the blueprint of a BankAccount object. Check out the design of a BankAccount class. 1. In BankAccount.java class, all of the method stubs ( methods with a header but empty bodies ) are present to help you get started. Your task is to complete the method bodies. All comments in red in the diagram above indicates what...

  • The following C++ code include 3 files: Patient.h, Patient.cpp and Main.cpp. The program basically creates and stores patient records. The original code has everything in a single .cpp file. I tried t...

    The following C++ code include 3 files: Patient.h, Patient.cpp and Main.cpp. The program basically creates and stores patient records. The original code has everything in a single .cpp file. I tried to divide the code in 3 parts (Patient.h, Patient.cpp and Main.cpp), but it is giving me errors. Patient.h #ifndef PATIENT_H #define PATIENT_H #include <string> #include "Patient.cpp" using namespace std; class Patient{ private : string firstname; string lastname; string location; static int cnt; int id; public : Patient(string, string, string);...

  • CSC110 Lab 6 (ALL CODING IN JAVA) Problem: A text file contains a paragraph. You are to read the contents of the file, store the UNIQUEwords and count the occurrences of each unique word. When the fil...

    CSC110 Lab 6 (ALL CODING IN JAVA) Problem: A text file contains a paragraph. You are to read the contents of the file, store the UNIQUEwords and count the occurrences of each unique word. When the file is completely read, write the words and the number of occurrences to a text file. The output should be the words in ALPHABETICAL order along with the number of times they occur and the number of syllables. Then write the following statistics to...

  • Write in JAVA Get Familiar with the Problem Carefully read the program description and look at...

    Write in JAVA Get Familiar with the Problem Carefully read the program description and look at the data file to gain an understanding of what is to be done. Make sure you are clear on what is to be calculated and how. That is, study the file and program description and ponder! Think! The Storm Class Type Now concentrate on the Storm class that we define to hold the summary information for one storm. First, look at the definition of...

  • HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE...

    HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE PROGRAM RUNS. Task 1: Enforcing const-ness throughout Your first job will be to go through all of the code and decide which functions should be declared const. You should find several places throughout the program where this makes sense. We will also make the id data member in the Customer class const , as once a customer has been created their ID will never...

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