Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Classroom.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# include <iostream>
# include <string>
# include "Classroom.h"
using namespace std;

Classroom::Classroom(int x, string y) {
seats = x;
location = y;
}

void Classroom::setSeats(int x) {
seats = x;
}

int Classroom::getSeats() {
return seats;
}

void Classroom::setLocation(string y) {
location = y;
}

string Classroom::getLocation() {
return location;
}
17 changes: 17 additions & 0 deletions Classroom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# include <iostream>
# include <string>
using namespace std;

class Classroom {
public:
Classroom(int x, string y);
void setSeats(int x);
int getSeats();
void setLocation(string y);
string getLocation();

private:
int seats;
string location;

};
24 changes: 24 additions & 0 deletions Room.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# include <iostream>
# include <vector>
# include <string>
# include "Classroom.h"
using namespace std;

int main() {

vector <Classroom> room;

room.push_back({50 , "Lesile Robinson Building"});
room.push_back({ 40, "Roy Marshall Teaching Complex" });
room.push_back({ 45, "Roy Marshall Teaching Complex" });
room.push_back({ 60, "Clico Building" });

for (unsigned int i = 0; i < room.size(); i++) {
cout << "Information about Room " << i + 1 << "\n";
cout << "Number of seats: " << room[i].getSeats() << "\n";
cout << "Location: " << room[i].getLocation();
cout << "\n";
}
system("pause");
return 0;
}