Hi, I'm new to C and I want to have a user input a bunch of grades and calculate the gpa.
I want to have some type of variable whether it's float or int or whatever (i'm not sure what will work, this is part of my question) named grades. In a for command which I already have worked out, when the user is prompted for a grade:
If they type in an A, the computer will know that A means 4.00, if they type B, the computer will know that B means 3.00, then I'm going to have a floating point for the variable totalgrades and it will be something likeCode:scanf("%whatever", grades);
What I cannot figure out is how to assign the inputted letters numbers.Code:totalgrades+=grades;
EDIT: If you want to see the code, I'll paste it but I didn't want to waste space.