Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are asked to write a program which enters three test scores plus their weighting factors. The program then calculates the weighted average. Based on

image text in transcribed
You are asked to write a program which enters three test scores plus their weighting factors. The program then calculates the weighted average. Based on that average it then determines the letter grade: A, B,C,D, or. F. The standard grading scale of 90s for an A,80s for a B, etc. Your program must have a main function and two additional functions that you create: calc_average and determine grade. The main program inputs three test scores (floats) with each score in the range of 0 to 100 . Also, input are three weighting factors which must be positive floating-point numbers not to exceed 3.0. Use while loops in the main to assure that all the test scores and weights are in the required range. The loops will exit only when the scores and weights are in the range noted. After the Input is validated, main calls calc average which accepts the three test scores and three weights as their parametera. The calc average then computes the weighted average and returns the value to the main function. Next main calls determine grade which takes the weighted average returned by calc average and uses selection structures to determine the letter grade (string data type). The main function then outputs the letter grade together with a message. If the grade is an A then "Congratulations" is printed. For a B the message is "Good Jab" and for a C the message is "Average work". For a D the print "You may need to repeat the course." Lastly print for an F, "Sorry, failure - repeat the course." Use the standard header comments and enclose output for three cases at the end of the file delimited by apostrophes

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions