| | |
point me in the right direction - Exam/quiz etc result calculating programme
![]() |
•
•
Join Date: Dec 2006
Posts: 2
Reputation:
Solved Threads: 0
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.
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
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).
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).
¿umop apisdn upside down? •
•
Join Date: Dec 2006
Posts: 2
Reputation:
Solved Threads: 0
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.
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?
Has the student passed both components and achieved 39%?
Has the student achieved over 40% but failed one of the components?
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.
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 ifHas the student passed both components and achieved 39%?
C++ Syntax (Toggle Plain Text)
if ( assessment passed is true, AND overall mark is 39% ) adjust overall mark to 40% end if
Has the student achieved over 40% but failed one of the components?
C++ Syntax (Toggle Plain Text)
if ( assessment passed is false, AND overall mark is 40% or more ) adjust overall mark to 39% 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.
¿umop apisdn upside down? •
•
•
•
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.
•
•
•
•
One way to begin with a task like this is break everything down is to bite-sized pieces.
Ask specific questions and post the code that is giving you problems and we can help you correct it.
•
•
•
•
You probably want to break the solution down into several functions, to make life easier, and avoid repeating code
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
![]() |
Similar Threads
- Dont know where to go next. (Java)
- how to code single/double quotes inside the quotes. (PHP)
- Unary Operators (C++)
- limiting account names (PHP)
Other Threads in the C++ Forum
- Previous Thread: help for error
- Next Thread: array output came many times (char,int array)
| Thread Tools | Search this Thread |
api array background based binary bitmap build c++ c++intmain() c/c++ char class classes client code coding compile console conversion copyanyfile count counttheoccurenceofanintegerinthe10inputs delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption environment error file forms fstream function functions game givemetehcodez graph gui homeworkassignment homeworkhelp homeworkhelper i/o iamthwee ifstream input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple multipledimensionarray news node numbers output pointer problem program programming project python radix random read recursion reference rpg string strings temperature template test text text-file tree url variable vector video vtk win32 windows winsock wordfrequency wxwidgets






