| | |
can anyone help me with this C program?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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:
Phavan 010896 AAACDBBBACDABCDDDADD
Fehreed 170208 DABCBBCADCDABDDDCADD
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
Passes : 80%
Failures : 20%
..........................................................................................................
Thanks in advance
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:
Phavan 010896 AAACDBBBACDABCDDDADD
Fehreed 170208 DABCBBCADCDABDDDCADD
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
Passes : 80%
Failures : 20%
..........................................................................................................
Thanks in advance
"If it moves, tax it. If it keeps moving, regulate it, and if it stops moving, subsidize it" - Ronald Reagan
•
•
•
•
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
Last edited by iamthwee; Jul 27th, 2008 at 6:02 pm.
*Voted best profile in the world*
•
•
•
•
I'll try to use them [code tags] from now on, didn't know it before, so thanks again
- Please use BB Code and Inlinecode tags
- Read This Before Posting
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
Join Date: Jun 2008
Posts: 68
Reputation:
Solved Threads: 6
•
•
•
•
Really? At the top if this forum are the following posts: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?
- Please use BB Code and Inlinecode tags
- Read This Before Posting
Just kiddin'
Is it such a big deal? the code wasn't even big atall.
Just a reminder is enough. To start using it.
![]() |
Similar Threads
- Playing .Wav/MIDI files in a Visual Basic Program (Visual Basic 4 / 5 / 6)
- What's the HARDEST program you've written? (Computer Science)
- Cool little Program to disable startup programs (Windows NT / 2000 / XP)
- Program is shutting down right after program is executed (C++)
- 3d Program (Game Development)
Other Threads in the C Forum
- Previous Thread: Passing an integer by adress
- Next Thread: Problem with memory free in C
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures student suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h







