I am making a program for my week 1 programming II class. The assignment is...
Create a structure for a classroom. Make sure it includes the following:
Room Number,
Lecture Name,
List of Students,
Number of chairs,
Window (Yes/No),
Projector (Yes/No),
Available(Yes/No).
Instructions:
• Create functions that allow you to add data to the attributes of the classroom.
• Create functions that allow you to print out the classroom information.
• Compare two classrooms based on the size (number of chairs) and report which classroom is larger. Also compare two classrooms base on utilization.
this is what I have so far...
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <math.h>
#include <algorithm>
using namespace std;
int main()
{
struct classroom
{
int room_number, number_of_chairs;
int number_of_students;
vector<string> student;
string students[number_of_students];
string Lecture_name;
} my_classroom;
cout << "What is your Classroom Number? ";
cin >> my_classroom.room_number;
cout << endl << endl;
cout << "How many chairs are in your classroom? ";
cin >> my_classroom.number_of_chairs;
cout << endl << endl;
cout << "How many students are there? ";
cin >> my_classroom.number_of_students;
cout << endl << endl;
//my_classroom.student.push_back(students[0]); This is what I am trying to do.
system("pause");
return 0;
}
my error is in my struct classroom class. It is not allowing me to have string students[number_of_students];
Can anyone explain to me why I can't have that or can someone show me a way to have this code working?
Thank You for your time. Merry Late Christmas and Happy New Year.