can anyone help me with this C program?

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2008
Posts: 6
Reputation: dapcigar is an unknown quantity at this point 
Solved Threads: 0
dapcigar's Avatar
dapcigar dapcigar is offline Offline
Newbie Poster

can anyone help me with this C program?

 
0
  #1
Jul 24th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 79
Reputation: Adak is an unknown quantity at this point 
Solved Threads: 7
Adak Adak is offline Offline
Junior Poster in Training

Re: can anyone help me with this C program?

 
1
  #2
Jul 24th, 2008
Yes, we can help, but I see no program to help.

We help - we do not *do* the homework for you.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 68
Reputation: Tigran is an unknown quantity at this point 
Solved Threads: 6
Tigran Tigran is offline Offline
Junior Poster in Training

Re: can anyone help me with this C program?

 
0
  #3
Jul 27th, 2008
this is certainly homework, Why do you actually choose to have this at school if you don't want to take the time write your algorythms?

i'll give you a start:
#include <fstream>
#include <iostream>
using namespace std;

int main(){
// all you have to do is this part
return 0;
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2,048
Reputation: Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of 
Solved Threads: 178
Aia's Avatar
Aia Aia is offline Offline
Postaholic

Re: can anyone help me with this C program?

 
0
  #4
Jul 27th, 2008
>i'll give you a start:
That's not a C program.
Learn how to properly use C programming tags.
"If it moves, tax it. If it keeps moving, regulate it, and if it stops moving, subsidize it" - Ronald Reagan
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 68
Reputation: Tigran is an unknown quantity at this point 
Solved Threads: 6
Tigran Tigran is offline Offline
Junior Poster in Training

Re: can anyone help me with this C program?

 
0
  #5
Jul 27th, 2008
Thanks

I'll try to use them from now on, didn't know it before, so thanks again

-Tigran
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 251
Reputation: ssharish2005 is on a distinguished road 
Solved Threads: 20
ssharish2005's Avatar
ssharish2005 ssharish2005 is offline Offline
Posting Whiz in Training

Re: can anyone help me with this C program?

 
0
  #6
Jul 27th, 2008
Haha, here we have one more homeword thread?

Dapsigar, show us a bit of progress on this assignment. You could expect some more help!

ssharish
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: can anyone help me with this C program?

 
1
  #7
Jul 27th, 2008
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
Is it just me, or does that example sort by matrix number/ marks instead of name?
Last edited by iamthwee; Jul 27th, 2008 at 6:02 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,121
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 282
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: can anyone help me with this C program?

 
0
  #8
Jul 29th, 2008
Originally Posted by Tigran View Post
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?
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: can anyone help me with this C program?

 
-2
  #9
Jul 30th, 2008
I do believe post #3 was counter productive, at least, for the OP.
Last edited by iamthwee; Jul 30th, 2008 at 3:24 am.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 68
Reputation: Tigran is an unknown quantity at this point 
Solved Threads: 6
Tigran Tigran is offline Offline
Junior Poster in Training

Re: can anyone help me with this C program?

 
1
  #10
Jul 30th, 2008
Originally Posted by WaltP View Post
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC