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

Can someone help please. I had help but it\'s not working. PLEASE DO BOTH PARTS!

ID: 3863456 • Letter: C

Question

Can someone help please. I had help but it's not working. PLEASE DO BOTH PARTS! Please make sure to read the entire problem and do both parts PLEASE DO NOT write it out I have a hard time reading people's hand writing please just type it out. Thanks for any and all help I appreciate it! Here is the problem:

Part A:

Write a c++ program that prompts the user to enter information about course enrollments, and writes this data to file coursedata.txt, located in the folder Test on drive C:. Use CSIT courses currently being offered, but include only those taught by one of the following professors: Buzi, Hu, Maloney, Scialdone, Zubairi. For each course, enter the subject code and number, the instructor's last name, and the enrollment -

for example:

CSIT 201

Zubairi

30

CSIT 221

Buzi

16

CSIT 241

Maloney

24

...

CSIT 463

Buzi

22

Note that the data should be written to the file in increasing order by course number.

Part B:

Write a program that reads the data from the file produced in Part A, and produces a report showing the courses taught by each instructor, along with their enrollments, and the total enrollment for that instructor. This report should be written to the file coursereport.txt, located in the folder Test on drive C:.

It should be in order by instructor last name -

for example:

Buzi

CSIT 221 16

CSIT 341 25

CSIT 463 22

Total: 63

...

Zubairi

CSIT 201 30

CSIT 251 23

CSIT 425 15

Total: 68

Explanation / Answer

// Example program
#include <cstring>
#include <iostream>
#include <string>
#include <fstrean>
void readFile();
int main()
{
std::string courseCode;
std::string courseNum;
std::string professorName;
std::string totalEnrollment;
std::string courseLefttoEnter = "Y";
std::ofstream out("output.txt");
while(1){
std::cout << "Course Code ";
getline (std::cin, courseCode);
std::cout << "Course Number ";
getline (std::cin, courseNum);
std::cout << "Professor Last Name ";
getline (std::cin, professorName);
   std::cout << "Total Enrollment";
getline (std::cin, totalEnrollment);
std::cout << "Still want to add?";
getline (std::cin, courseLefttoEnter);
if (!strcmp(courseLefttoEnter.c_str(),"N")){
        break;    
}
out <<courseCode<<" "<<courseNum<<" "<<professorName<<" "<<totalEnrollment;
}
out.close
readFile();
}
void readFile(){
ifstream infile;
infile.open("ouput.txt");

}