473,944 Members | 25,983 Online

# Calculation of averages

5 New Member
i need to calculate the average of the class by taking info of 3 students midterm and final grades to find who passed and who failed show which one got highest and lowest mark midterms percentage is%40 final is%60 if the average grade of a student is 50 he or she will pass.. if someone who got below 50 in final will fail directly.. how can i write this programme
Mar 21 '07 #1
9 2145
Roonie
99 New Member
well . . . how will you store the data you need to process?
Mar 21 '07 #2
kelso00
5 New Member
just by entering the values i mean i will enter values for mid. final then do the calculation and get the result who passed and failed
Mar 21 '07 #3
kelso00
5 New Member
anyone plz help its soooo urgent i need to calculate the average of the class by taking info of 3 students midterm and final grades to find who passed and who failed show which one got highest and lowest mark midterms percentage is%40 final is%60 if the average grade of a student is 50 he or she will pass.. if someone who got below 50 in final will fail directly.. how can i write this programme

--------------------------------------------------------------------------------
Mar 21 '07 #4
Banfa
9,065 Recognized Expert Moderator Expert

For each student you need to get the mid-term and final mark, and using these marks work out if they have passed or not.

The first step is to work out how you would do the calculation in a specific case on paper.

The second step is to generalise that to a calculation for any case.

The third step is to convert the generalise algorithm to usable C code.
Mar 22 '07 #5
Roonie
99 New Member
i mean, will you be using ints?

how many do you need? what will you call them? you will be setting their values from cin?

we wont write a program for you, but we can help you in the right direction.
Mar 22 '07 #6
kelso00
5 New Member
float ,3,from cin
Mar 22 '07 #7
Roonie
99 New Member
ok, so you have so far
Expand|Select|Wrap|Line Numbers
1. float x, y, z;
and
Expand|Select|Wrap|Line Numbers
1. cin >> x >> y >> z;
what calculations do you need to perform to get the right information?
Mar 22 '07 #8
kelso00
5 New Member
i gotta take the averages that i expained above %60 of the final %40 of the than take the class average to decide who pass and who failed..
Mar 22 '07 #9
Roonie
99 New Member
so im assuming that either x, y or z will be the midterm and another one will be the final grades? maybe another one will be the result?

how would you write a statement to perform this arithmetic and store the answer in the appropriate place?

(you have to be trying on your own here, not just telling me what you need to have in the end.)
Mar 22 '07 #10