943,516 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2768
  • C++ RSS
Jan 2nd, 2007
0

point me in the right direction - Exam/quiz etc result calculating programme

Expand Post »
Hi,
I am pretty new to C/C++, and would like some tips on writing the code fo my first 'try' I am trying to write a programme that marks exams and such and calculates grades. I am not looking for somebody to write it for me, well if you want to, haha, but just maybe a point in the right direction, or a few snippits of code to help me along the way. I have a personal tutor who set me this task, and told me to get help where needed, as i want to go into a new career, and want to learn quickly, so your help would be much appreciated. there is a scenario;

Exam and coursework components of the assessment carry a maximum of 50 marks. Pass or fail are determined by:

Combined component total of 40% or more in order to Pass.

Minimum for each component is 15% pass

39% is moderated to 40% and a ‘Moderated Pass’ is awarded.

40% or more overall but minimum component mark not achieved ‘Technical Fai’l of 39% (which is NOT moderated to 40%);

Grades are awarded on marks that fall into the following categories:
Mark - 100-70 69-50 49-40 38-0
Grade - A B C Fail

Thanks in advance for the help.
Last edited by l36963; Jan 2nd, 2007 at 5:54 am. Reason: forgot something
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
l36963 is offline Offline
2 posts
since Dec 2006
Jan 2nd, 2007
0

Re: point me in the right direction - Exam/quiz etc result calculating programme

Which language are you learning, C or C++? (The two languages are very different) and how far have you managed to get with the problem? you're likely to get more useful feedback if you post your attempt at a solution so far.

One way to begin with a task like this is break everything down is to bite-sized pieces. Often it helps to write some kind of informal pseudocode. (If not in a text editor, then on a sheet of paper)

certain parts of the problem should be very straightforward, such as converting a number of marks out of 50 into a percentage.

Other parts of the problem, such as determining the pass/fail status of a student will need a bit more thought - and, depending how much of the language you know, there are different ways you could solve it (You probably want to break the solution down into several functions, to make life easier, and avoid repeating code).
Reputation Points: 307
Solved Threads: 62
Posting Pro
Bench is offline Offline
565 posts
since Feb 2006
Jan 2nd, 2007
0

Re: point me in the right direction - Exam/quiz etc result calculating programme

To be honest i don't know to much of the language yet, i jst started learning, it's c++ language, i'm finding it slightly difficult, i have books to help, but i wanted a bit more practical advice, the books help with input of the values, but not so much how to make the programme calculate, i.e. the pass/fail, moderating etc... that seems quite a task to me.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
l36963 is offline Offline
2 posts
since Dec 2006
Jan 2nd, 2007
0

Re: point me in the right direction - Exam/quiz etc result calculating programme

For converting from a mark into a grade, you should look up If/Else blocks in your book.

For other parts of the program, one approach you could use may be to store a true/false value (a boolean value) for whether or not the assessment has been passed.

here's some pseudocode snippets, based on your description of the problem-


Has the student achieved the minimum for both components?
 assume the student has passed until we find out they've failed..
assessment passed = true;
if ( Exam mark is below the threshold OR Coursework mark is below the threshold )
    assessment passed = false
end if

Has the student passed both components and achieved 39%?
C++ Syntax (Toggle Plain Text)
  1. if ( assessment passed is true, AND overall mark is 39% )
  2. adjust overall mark to 40%
  3. end if

Has the student achieved over 40% but failed one of the components?
C++ Syntax (Toggle Plain Text)
  1. if ( assessment passed is false, AND overall mark is 40% or more )
  2. adjust overall mark to 39%
  3. end if

Try implementing these in C++ - After this, you should be in a position to calculate the final grade.

The best thing you can do is have a go at it and post your code here if you get stuck.
Last edited by Bench; Jan 2nd, 2007 at 11:04 am.
Reputation Points: 307
Solved Threads: 62
Posting Pro
Bench is offline Offline
565 posts
since Feb 2006
Jan 2nd, 2007
0

Re: point me in the right direction - Exam/quiz etc result calculating programme

Click to Expand / Collapse  Quote originally posted by l36963 ...
To be honest i don't know to much of the language yet, i jst started learning, it's c++ language, i'm finding it slightly difficult, i have books to help, but i wanted a bit more practical advice, the books help with input of the values, but not so much how to make the programme calculate, i.e. the pass/fail, moderating etc... that seems quite a task to me.
You need to take Bench's advice:


Click to Expand / Collapse  Quote originally posted by Bench ...
One way to begin with a task like this is break everything down is to bite-sized pieces.
In other words, can you input values correctly? Just do that step. Then move to the next step.

Ask specific questions and post the code that is giving you problems and we can help you correct it.

Click to Expand / Collapse  Quote originally posted by Bench ...
You probably want to break the solution down into several functions, to make life easier, and avoid repeating code
Just have main() call functions and each function does one step.
Moderator
Reputation Points: 3275
Solved Threads: 890
Posting Sage
WaltP is offline Offline
7,716 posts
since May 2006

This thread is more than three months old

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.
Message:
Previous Thread in C++ Forum Timeline: help for error
Next Thread in C++ Forum Timeline: array output came many times (char,int array)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC