PDA

View Full Version : help please


xomdao
09-14-2002, 07:04 PM
hi everyone,
i'm currently taking program in C for the first time in college. i have a homework assignment to do like this.

Write a program that predicts the score needed on a final exam to achieve a desired grade in a course. the program should interact with the user as follows:

Enter desired grade> B
Enter minimum average required> 79.5
Enter current average in course> 74.6
Enter how much the final counts as a percentage of the course grade> 25
You need a score of 94.20 on the final to get a B.



can someone show a me a way to get 94.2???? i know how to write program from then on...Thank you very much for taking time to read this post.

Trung Quốc
09-14-2002, 10:06 PM
That is calculation.

For instance:
char gradeletter;
double minavgrequired;
double curavgincourse;
double ptfinalcount;
double finalgrade;


Now if you want a grade B which is 79.5 then you have this equation

minavgrequired=curavgincourse *(1-ptfinalcount) + finalgrade * (ptfinalcount)
so if you want to fine finalgrade
then you need this fomular:
finalgrade =( minavgrequired - curavgincourse*(1-ptfinalcount))/ptfinalcount;

QT

xomdao
09-15-2002, 09:47 AM
Thanks alot Quoc Trung.