Question
C++ classes HELP. I have this coding homework and I dont understand what it is wanting differently. It is a program that reads in a
C++ classes HELP. I have this coding homework and I dont understand what it is wanting differently. It is a program that reads in a file that is basically a course directory states how many classes are in the file then, class code [like MATH or EECS], then code number, number of students and then all student id's for that class. I thought that the section where it is reading in the file would work but it is saying the courses.[blah] has not been declared.... So not sure what I should do... in order is the executive.cpp file, then exectutive.h and then main.cpp
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 printall); swap (courses [firstIndex].courseName, courses [secondIndex].courseName); void Executive:schedule int ID; cout > ID; cout > dept; 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 for (int i0i courseNo; cout > dept2 for (int j 0; j courseNo2 for ( int x=; x max) max courses [1] .numStudents; for(int i- 0: i department; for(int i0: i courseNum; for ( int =0; > option; while (option >7 I option > option: if (option1) printall ) 37 38 39 40 41 42 43 while (getline (file, line)) i 0: char str = const cast-char>(line. c str ( ) token= strtok (str, " "); while (token NULL) 45 46 47 48 49 50 51 52 53 54 if (j-0) strcpy (courses[i].courseName, token) else if (j - 1) courses[i].courseNum-atoi (token) else if(j-2) 56 57 58 59 60 61 62 63 64 65 courses [i].numStudentsatoi (token): else courses [1]. IDs [j - 3] = atoi (token); token = strtok (NULL, " "); 67 68 69 70 71 72 73 file.close ) include"executive.h" #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started