Description of tasks:
You are required to write a program that will calculate the total marks and the grade the student obtained on a multiple choice test paper. There are 20 questions and each question has an option A,B,C and D. Total of 30 students took the test. The correct answers are stored in an array form as the following:-
char answers[] = {“DAACBBCADCBAABDCDADD”};
The student’s name , matrix number and their answers are stored in a file called answers.dat in the following format:
Each correct question carries 5 marks. The grade obtained is based on the criteria below:-
Marks Grade
100 to 70 - A
69 to 60 - B
59 to 50 - C
49 to 40 - D
39 and below - F
Problem Statement
Write a program that will display the following :-
1) the total marks and grade for each student
2) total number of students for each grade
3) percentage of passes and failures.
Read the data from the file answers.txt and calculate the marks and determine the grade the student obtained. Store the results in another file called results.txt in the following format. The records must be sorted based on the name.
Report on the CSC202 test
Name Matrix Number Total Marks Grade
Ali 1225 90 A
Dave 1227 87 A
Chen 1300 69 B
……
……
Total number of students who scored A : 5
Total number of students who scored B : 6
Total number of students who scored C : .10
Total number of students who scored D :5
Total number of students who scored F :4
I'll try to use them [code tags] from now on, didn't know it before, so thanks again
Really? At the top if this forum are the following posts:
Please use BB Code and Inlinecode tags
Read This Before Posting
Additionally info is listed in The Forum Rules you were asked to read multiple times when you registered. And if that's not enough, they are also explained on the background of the box you posted all your messages in. What else could we have done to help you?
Really? At the top if this forum are the following posts:
Please use BB Code and Inlinecode tags
Read This Before Posting
Additionally info is listed in The Forum Rules you were asked to read multiple times when you registered. And if that's not enough, they are also explained on the background of the box you posted all your messages in. What else could we have done to help you?
What should i now do? go kill myself?
Just kiddin'
Is it such a big deal? the code wasn't even big atall.
Just a reminder is enough. To start using it.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.