446,332 Members | 1,414 Online
Need help? Post your question and get tips & solutions from a community of 446,332 IT Pros & Developers. It's quick & easy.

# Calculation of averages

 P: 5 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 Replies

 P: 99 well . . . how will you store the data you need to process? Mar 21 '07 #2

 P: 5 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

 P: 5 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

 Expert Mod 5K+ P: 8,916 Firstly please don't double post your question, please do read the Posting Guideline in the FAQ. 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

 P: 99 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

 P: 5 float ,3,from cin Mar 22 '07 #7

 P: 99 ok, so you have so far Expand|Select|Wrap|Line Numbers float x, y, z; and Expand|Select|Wrap|Line Numbers cin >> x >> y >> z; what calculations do you need to perform to get the right information? Mar 22 '07 #8

 P: 5 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

 P: 99 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