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

Yes, we can help, but I see no program to help.

We help - we do not *do* the homework for you.

commented: Well said +19

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;
}

>i'll give you a start:
That's not a C program.
Learn how to properly use C programming tags.

Thanks

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

-Tigran

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

Member Avatar for iamthwee

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?

commented: waweeee! I see what you see .. O_O +5

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:

  • Read This Before Posting
  • Please use BB Code and Inlinecode tags

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?

Member Avatar for iamthwee

I do believe post #3 was counter productive, at least, for the OP.

commented: And pointing this out does nothing to help further the discussion, either. If you have nothing helpful to add, don't post. -3

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.

commented: Your are fine. Keep posting. +8

Is it such a big deal?

Yes. If it wasn't a big deal, why would we mention it in so many places?

If you can't follow simple instructions, you will never be a good programmer -- nor a good anything else.

Well, don't want to get too much off-topic though, but first off, i thought the instructions were general forum instructions with things like don't go offtopic etc.
second, i've seen dozens of non-tagged codes, and never did so many mods etc respond to them.
an third, if you expect every single member that makes a post to make a perfect post, then you won't get many posts, really.
I hope we won't get this topic further off-topic.

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:

dont i know how to start a program ? Im just asked u to do the program completely.Dont think and talk like a genius.If u know the answer then give a thread otherwise plzzzzz

commented: If you had read this thread carefully enough, you should have seen a referrer to the forum rules, and if you hadn't read them before, you should have read them after seeing that referrer. BTW, this thread is nearly a year old!! -2

Write a C program to store students records in a file

@mcamaher:

This thread is over a year old, and your request is likely to simply be buried in all the replies to the original poster.

May I strongly suggest you start a NEW thread, and add in two things:

1) Your effort to make the program, so far

and

2) Your specific problems that are stopping you, atm.

Just posting up for help, and showing no work, gets very little traction in this forum (or most forums for programming).

They don't want to just do your work, for you.

And welcome to the forum! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.