
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This computer assignment requires students to write a program in c or c++ to read an ascii file named test.txt containing the results of a true-false exam given to a group of students. The program should read the correct answers from the first line, read students' id numbers and answers, compute and store the number of correct answers for each student, determine the average score, and print a three-column table on the screen displaying the id number, score, and grade for each student. The grades are determined based on whether the score is larger than the average score.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

th Create an ASCII file, test.txt, as shown below using text editor. It contains the results of a true-false exam given to a group of students. You may assume that the number of students will always be less than 20. The first line contains the key answer representing the 10 correct answers. Starting from the second line, each line of the data file contains the student identification number and the student’s answer to 10 true-false questions. A sentinel value of 9999 has been used. Write a program that reads as input the file test.txt. The program should start by readng the correct answer from the first line into a 1-D character array named correct_answers, then do the following tasks: