Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ class this program will have 4 headers, 4 cpp, and main.cpp The Campus is di

ID: 3669157 • Letter: C

Question

C++ class

this program will have 4 headers, 4 cpp, and main.cpp

The Campus is divided into Buildings. Each building has a name, a type and an ID. There are two types of buildings: Academic (a) Recreation (r).
Each campus can have at most 10 buildings. And there is a limit of 7 for a single type of building. In other words, you cannot have a campus with just 8 academic buildings or just 8 recreation buildings.
The Academic buildings contains a set of classrooms. Each classroom is identified by its number.
The Recreation buildings specifies the type of the activity it offers (sports, games, movies)
This electronic guide offers a set of functionalities:
1- Load the building list in the memory by reading the provided file.
2- Search: the user can either view a list and choose a building from this list, or by entering the ID of the building.
3- When a building is selected it displays a description of the building.

In this assignment, you are asked to design and implement the electronic guide application (main.cpp). The load operation is done automatically when the application starts. The application offers a menu to select the action you need to perform either type of search.
Before you go further with this programming exercise, please notice that you must follow all object oriented programming approaches and conventions.

You are going to define the class Campus based on the specifications below.
1. A Campus must have 2 arrays of each type of building (Academic,Recreation) and 2 counters called numberOfAcademic, numberOfRecreation that counts the number of each type of building object created. These are members of the campus class, so they are not static variables. All variables MUST be private. You MUST NOT initialize these variables.

2. The Campus class must have a public static const constant calledmaxPerBuildingType that contains the maximum number of individual Academicand Recreation objects that can be created. Please set maxPerBuildingType to 7.

3. Please define a no-argument constructor (the default constructor). Initializes every counter to 0.

4. Please define 3 public member functions called
a) loadFile, which reads from the provided file and fills the arrays with the provided informations in the file.
b) In the predesign.txt file explain your implementation of how you will read the file. example of file campusUH.txt

a-101-Mathematics-5-Main building for the math department math related courses.
r-102-Student Union-10-A central location for students to gather for social events.
a-222-Library-2-University library to assist students in research with a collection of over 100,000 books.
a-207-Physics-15-World renowned physics laboratory.

File is ‘-’ delimited. First line means:

a: add Academic building to campus

101: ID of building

Mathematics: name of building

5: number of classrooms (would be stores if a recreation building)

Maincourses.: description text for the building object.

c) searchList, that displays a list of all the buildings, allows the user to input number of the building in the list and displays the description of the building.

Sample List

Please choose a building:
101-Mathematics
102-Student Union
222-Library
207-Physics
Enter building ID:

• User must enter the Building ID number
• If valid input given, the showFullDescription function of that building will be called.
• If invalid input, message displayed that informs user of bad input.

d) searchName, that allows the user to input the name of a building and displays the description of the building.
• Note that names have spaces so you must use getline function properly to get user’s input.
• If match found then the showFullDescription function of that building will be called.
• If not found, message displayed that informs user of bad input.

5. Please define 1 private member function (helper) called
Display, that takes as an argument the array containing the object to display and the index of that object in the array.

You must define the class Campus in 2 separate files called:
1. Campus.h, which is the interface file. You must first create this file. The interface file consists of member variable and function declarations (i.e., class definition). Interface file Campus.h template:
2. Campus.cpp, which is the implementation file. You must include class Campusinterface file (NOT THE CLASS INTERFACE) in the implementation file. The implementation file consists of the function definitions. Please notice that constructors are also functions.

The same templates apply for the remaining classes.
Then, you are going to define the class Building based on the specifications below.
1. A Building must have an ID (type of int), a name (type of string), and a description (type of string). In other words, the class Building must have 2 member variables. All variables MUST be private. You MUST NOT initialize these variables.
2. Please define a no-argument constructor (the default constructor).
This constructor does not initialize anything.
3. Please define a constructor that takes three arguments: ID (type of int), name (type of string), description (type of string)
Please assign the constructor argument values to the member variables of the class Building.
4. Please define 8 public member functions called
o getID
o setID
o getName
o setName
o getDescription

o setDescription

5. Please define a virtual function showFullDescription()
o This function will be implemented by the derived classes.
o In addition to the description variable, it will also add additional information about the building.

Then, you are going to define the class Academic based on the specifications below.

1. An Academic building must inherit from the class Building. It must have a variable numOfRooms (type of int). In other words, the class Academic must have 1 member variables. All variables MUST be private. You MUST NOT initialize these variables.
2. Please define a no-argument constructor (the default constructor).
You must not do anything.
3. Please define a constructor that takes three arguments: ID (type of int), name (type of string), description (type of string), numOfRooms (type of int)
Use initializer list to call base class constructor for ID, name, description
Please assign numOfRooms value to the member variable of the classAcademic.
4. Please define 2 public member functions called
getNumOfRooms
setNumOfRooms
5. You must also implement/define the virtual function, showFullDescription(), that was inherited from Building
Use the public getDescription() function
Also incorporate the number of rooms when the full description is displayed.

Then, you are going to define the class Recreation based on the specifications below.
6. A Recreation building must inherit from the class Building. It must have a numOfStores (type of int). The variable MUST be private. You MUST NOT initialize this variable.
7. Please define a no-argument constructor (the default constructor).
You must not do anything.
8. Please define a constructor that takes three arguments: ID (type of int), name (type of string),
description (type of string), numOfStores (type of int)
Please use the constructor from the base class.
Please assign the corresponding argument to the member variable of the class Recreation.
9. Please define 2 public member functions
getNumOfStores
setNumOfStores
10. You must also implement/define the virtual function, showFullDescription(), that was inherited from Building
Use the public getDescription() function
Also incorporate the number of stores when the full description is displayed.

Finally, you are going to create the main executing loop (i.e., main.cpp).
1. Declare an instance of Campus called UH.
2. Load the file campusUH.txt into UH variable.
3. Create a menu loop that gives user 3 options
1) Search by List
2) Search by Name
3) Exit
4. Option 1 calls the searchList function. After the function completes execution, program will ask if user wants to do another search.
5. Option 2 calls the searchName function. After the function completes execution, program will ask if user wants to do another search.
6. Option 3 exit/ends program
7. Following is the campusUH.txt file that will be used in conjunction with your main.cpp

a-101-Pythagoras Mathematics-5-Main building for the math department math related courses.
r-102-Student Union-10-A central location for students to gather for social events.
a-222-Central Main Library-2-University library to assist students in research with a collection of over 100,000 books.
a-207-Imagine Physics Lab-15-World renowned physics laboratory.
a-331-Lucky 7 Computer Lab-7-Building that has 7 rooms with top-of-line computers.
r-490-Excel Stadium-1-Large stadium to hold sporting events.
r-521-Fashions R Us-9-Building of clothing stores.
a-632-Reboot Computer Science-12-Building that hosts a rising computer science program.

Explanation / Answer

Hi below i written a code that explains a basic concept for understanding your requirements to develop your code in C++

Class Campus {

long Id;

char City[20];

protected:

char Country [20];

public:

Campus() ;

void Register() ;

void Display ();

};

class Dept :

private campus

{

Iong DCode [ 10] ;

char HOD [20] ;

protected :

double Budgets ;

public: Dept ();

void Enter ();

void Show0 ;

};

class Applicant:

public Dept {

long RegNo;

char Name [20] ;

public:

Applicant() ;

void Enroll ();

void View ();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote