im having trouble running the program, every time i opens it just closes can some please help me!!
Question
the Computer Science department needs help in grading a True/False test. The students' IDs and test answers are stored in a file. The first entry in the file contains the answers to the test in the form:
TFFTFFTTTTTTFFTFTFTT
Every other entry in the file is the student ID, followed by a blank, followed by the student's responses. For example, the entry:
ABC54301 TFTFTFTT TFTFTFFTTFT
indicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and so on. This student did not answer question 9. The exam has 20 questions, and the class has more than 150 students. Each correct answer is awarded two points, each wrong answer gets -1 point and no answer gets 0 points. Write a program that processes the test data.
The output should be the student's ID, followed by the answers, followed by the test score, followed by the test grade. Assume the following grade scale:90%-100%, A; 80%-89.99%, B; 70%-79.99%, C; 60%-69.99%, D; and 0%-59.99%, F.
Test your program with the following input file:(what is inside the file)
The problem is that you ask for a filename but try to open a different file.
1 2 3
cout << "Enter the file name:";
cin >> fileName;
inFile.open("studentdata.txt");
You also have two synthax errors:
1 2
for (int student = 0; student < studentsCounter, student++)
for (int i = 0; i < studentsCounter, i++)
After I fixed them I got the following output:
1 2 3 4 5 6 7 8 9 10 11
Enter the file name: Data.txt
Results of the students.
Student_ID Student_Answers Score Grade
ABC54102 T FTFTFTTTFTTFTTF TF 27 D
DEF56278 TTFTFTTTFTFTFFTTFTTF 40 A
ABC42366 TTFTFTTTFTFTFFTTF 34 B
ABC42586 TTTTFTTT TFTFFFTF 26 D
LKJ81672 TTTFTFFTFFTTFTFTF 7 F
STD24151 TFTFTTTFTFTFFTTF -1 F
Press any key to continue . . .