Question: Write a program in C: Description: One question I get asked frequently is What grade do I need to get on my final to get

Write a program in C:

Description:

One question I get asked frequently is "What grade do I need to get on my final to get an X in the class?" For this assignment you will be writing a program to answer that question. You should ask the user for the following in this order

  1. The letter grade you want to get in the class
  2. What percent you need to get in the class to get that grade (A value from 0 - 100. It may not be a whole number)
  3. What percent you currently have in the class
  4. The weight of the final. (A value from 0 - 100. Again it may not be a whole number)

After gathering the above information your program should output what percent you need to get on the final to achieve the desired grade.

Requirements:

  • The program must compile with both -Wall and -Werror options enabled
  • Submit only the files requested
  • Use doubles to store real numbers
  • Print all doubles to 2 decimal points unless stated otherwise

Assumptions:

  • All input is valid

Examples:

In the examples below user input has been underlined. You don't have to do any underlining in your program. It is just there to help you differentiate between what is input and what is output.

Example 1

Enter the grade you want in the class: B

Enter the percent you need to get that grade: 80

Enter your current percent in the class: 75

Enter the weight of the final: 20

You need to get at least 100.00% on the final to get a B in the class.

Example 2

Enter the grade you want in the class: A

Enter the percent you need to get that grade: 90

Enter your current percent in the class: 83

Enter the weight of the final: 30

You need to get at least 106.33% on the final to get a A in the class.

Example 3

Enter the grade you want in the class: B

Enter the percent you need to get that grade: 85

Enter your current percent in the class: 72

Enter the weight of the final: 50

You need to get at least 98.00% on the final to get a B in the class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!