Hello Everyone, I'm new to this board. I'm taking a class of which I have not taken the prerequisite. I have never programmed before, and now I have a simple program due tomorrow, and I'm at a loss at how to do it. Here's the problem
“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.”
I have no idea how to deal with the letter 'B' How do I assign a value to it? How do I use printf and scanf with this variable? I can manage the numerical operations, but I just really need help with the letter part of this assignment. Please let me know if you need clarification. Thanks!
- Kurt
.cCode:1 # include <stdio.h> 2 3 int main () 4 5 { 6 7 8 double desired, minimum, current, final; 9 printf("Enter desired grade> "); 10 scanf("%lf", &desired); 11 printf("Enter minimum average required> "); 12 scanf("%lf", &minimum); 13 printf("Enter current average in course> "); 14 scanf("%lf", ¤t); 15 printf("Enter how much the final counts\n"); 16 printf("as a percentage of the course grade> "); 17 scanf("%lf", final); 18 19 } ~



1Likes
LinkBack URL
About LinkBacks



