Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in Python to read scores for a test and valid scores are integer values from 0 to 100. You will NOT need

Write a program in Python to read scores for a test and valid scores are integer values from 0 to 100. You will NOT need a function to read the score value in this program.Once you read this value for score, pass that value to a function called findGrade() and this function will return a string of either PASS or FAIL If score is from 50 to 100 then it is a PASS else it is a FAIL grade. Then for the output, print the score together with the grade. Such as: 98 PASS 49 FAIL 110 PASS Output shown above are for THREE different runs of your program. But note that a score of 110 is an invalid score and hence should display an error message such as: 110 Invalid score. The error message of Invalid score should be displayed and then the function findGrade() is NOT called. In other words, the function findGrade() is ONLY called if the score is valid. Hence, add statement after reading the scores to validate the value entered to be in the range from 0 to 100 and only then, the findGrade() function will be called and only then you will print the score and the grade. Otherwise, display the score and an error message. Lastly, add a function called printInfo() that will accept the score and grade value and print these two values with some text to make the output meaninful. That means, if the score is valid, call the findGrade() function and also the printInfo() function. Otherwise, display an error message.

PLEASE SHOW FINAL SOURCE CODE IN THE END PLEASE

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

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

Define Leap year?

Answered: 1 week ago

Question

Prepare a short profile of Lucy Clifford ?

Answered: 1 week ago

Question

Prepare a short profile of Rosa parks?

Answered: 1 week ago

Question

Prepare a short profile of victor marie hugo ?

Answered: 1 week ago