Question
Please write the code that would make the task work. I will RATE your answer In this part, you will implement code to know what
Please write the code that would make the task work.
I will RATE your answer
In this part, you will implement code to know what the minimum final test grade for an given
expected final grade. This code to allow the user to submit three values for partial text and the
expected final letter grade and get as output the minimum numerical final test grade.
Create this program in a file expected_grade.c using this template:
/*
* Programmer:
* Class: CptS 121, Spring 2018
* Programming lab:
* Date:
* Description:
*/
#include
int main(void)
{
/*
* The main function should implement these steps:
*
* 1. Prompt the user to enter the three double values and the final
* letter grade (score1, score2, score3, final_score_letter).
* 2. Check to make sure the double is positive and the letter is
* correct. If it isn't, print out an error message and exit.
* 3. Implement this pseudocode:
* calculate the minimum numerical value for the final_score_letter
* use the formula to calculate the fourth score
*
* score4 = 4*final_score-score1-score2-score3
* print the numerical grade for score4
*/
return 0;
}
Compile the program with:
$ cc -Wall expected_grade.c -o expected_grade
Here's a typical run:
enter score 1: 80.5
enter score 2: 90.0
enter score 3: 75.3
enter letter : B
The minimum numerical grade for the fourth score to a get a
final grade B is 74.2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started