Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a safe harbor 401(k) plan?30

Answered: 1 week ago