Okay, trying again. If you only need one calculation... and I understand everything else correctly, then something like this (mind you, I'm not putting the number checks in as I'm not sure I understand them 100% and that can be your exercise -- unless that's what you're having difficulty with):
int main()
{
int readGrade();
int getHours(int num);
int num, hours;
num = readGrade();
hours = getHours(num);
/* print the results (probably hours as that's the last calculation I think) */
return 0;
}
int readGrade()
{
int num;
do
{
/* prompt the user.. */
}
while ((num>=0) && (num<=4)); /* see point one below */
return num;
}
int getHours(int num)
{
/* do the calculation stuff here in a loop */
return answer;
}
Okay, the point one.. you had...
while (num >= 0) && (num <= 4);
I changed it to while ((num >= 0) && (num <= 4));
why ? I'm pretty sure that would throw up an error (you're using a while loop but then you close it off after the first ) and there is no semi colon but instead a && and so on. I would be surprised if you didn't get a compiler error actually.
Anyway, let me know if this helped, or if you need something more.