Answered step by step
Verified Expert Solution
Question
1 Approved Answer
All part of the same problem. Please make sure to look at the instructions. Thank you! In this programming project you will implement a number
All part of the same problem. Please make sure to look at the instructions. Thank you!
In this programming project you will implement a number of Python functions to validate or transform values conditionally. Make sure you follow the provided style guide (you will be graded on it!). You are allowed to use round () and Len ( ), but other than that you are not allowed to use any other built-in method or function from any Python library. 2. It takes a float argument representing a grade from 0 to 100 , and it returns a string 3. It returns a letter grade based on the following rules: Greater or equal to 90 , return " A " Greater or equal to 80 , return "B" Greater or equal to 70 , return "ic" Greater or equal to 60 , return "D" Anything less, than 60 return "E" but greater or equal to 0 If argument is negative or greater than 100 , return " X " 1. Function name is pass_or_fail 2. It takes a string argument that is one character long, letter_grade and it returns a string 3. If the argument letter_grade is longer than one character, it returns 4. It returns Pass if letter_grade argument is equal to " A ", " B ", " C ", or " D " - otherwise it returns Fail Calculate percentage 1. Function name is point_grade 2. It takes two float arguments: score and total_points 3. It calculates the percentage grade by dividing score by total_points, and multiplies result by 100 (percentage =( score / total_points) 100) 4. It returns the calculated percentage as a float rounded at two decimals 3. It calls point_grade (a function you've written for this assignment) using the two float arguments: score and total_points - it saves the value returned to a variable to be used in the next steps 4. Using the calculated point grade value returned by your point grade function call (previous step), it calls the function letter_grade to retrieve the letter grade value associated with the calculated point grade and it saves it to a variable 5. Using the letter grade retrieved from the previous steps, it calls your pass_or_fail function to retrieve a Pass or a Fail and saves it to a variable 6. At this point you should have three variables: a point grade ( 0 to 100 value), a letter grade (A,B,C,D, or E), and a string that says either Pass or Fail - concatenate these three values into one string to be returned by the function 7. It returns a string similar to: Your grade is 92.34 ( A - Pass) or Your grade is 35.78 (E - Fail) 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