Can Someone Help Me Plz!!!
Write a C program that will assist with the student advisement process at a college. The program will provide the user with the following main options:
1. To calculate and display a student”¦s current GPA (Grade Point Average) given the grade obtained by the student in each course completed so far.
2. To calculate and display the student”¦s projected GPA given:
a. The grades that the student hopes to achieve in the new courses to be done in the coming semester.
b. The student”¦s current GPA.
c. The number of courses that the student has completed so far.
Notes
ę This program is concerned with GPA calculation in general ”V the names of courses are not important.
ę Each college course is worth 3 credits.
ę Quality points are assigned to grades as follows:
o A 4.0
o B 3.0
o C 2.0
o D 1.0
o F 0.0
ę Appropriate messages are to be displayed in the following cases:
o A student”¦s current GPA is below the minimum of 2.0
o A student”¦s projected GPA is below the minimum of 2.0
ę For each main option the user must be allowed to repeat the calculation as many times as desired.
ę The user must always have the ability to return to the main menu to make another choice.
ę Option 2 must be available as an immediate follow-up to option 1 and also as an independent option.
This is what i have so far:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
void main()
{
char grade;
float qualitypoints,tqp,cgpa,tc;
int count,coursecomp,crd,sum;
while(grade!='x'){
printf("Please enter grade obtained or 'x' to quit: ");
scanf("%c", &grade);
while(getchar()!='\n');
}
switch (grade) {
case 'a': qualitypoints=4.0;
case 'A': qualitypoints=4.0;
break;
case 'b': qualitypoints=3.0;
case 'B': qualitypoints=3.0;
break;
case 'c': qualitypoints=2.0;
case 'C': qualitypoints=2.0;
break;
case 'd': qualitypoints=1.0;
case 'D': qualitypoints=1.0;
break;
case 'f': qualitypoints=0.0;
case 'F': qualitypoints=0.0;
break;
default: printf("Invalid Grade!!!\n");
break;
}
sum=0;
while(grade=='x'){
qualitypoints=grade;
grade=grade+1;
printf("Total quality points are: %2.2f\n",qualitypoints);
}
while(grade!='x'){
printf("Please enter grade obtained: ");
scanf("%c", &grade);
while(getchar()!='\n');
}
system("PAUSE");
}
and it is not workin!!
i need a while statement that when a is enter it will recognize that 'a' is worth 4.0 quality points!!!