Question
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
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