Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Python. Please include revision details in the code and a few comments. Dr. Phloog teaches Python to extraterrestrials at Area 51. Each semester he

image text in transcribed

Use Python. Please include revision details in the code and a few comments.

Dr. Phloog teaches Python to extraterrestrials at Area 51. Each semester he gives a number of quizzes and he drops 1 out of 3 lowest grades. If he gives 35 quizzes, the lowest grade gets dropped before computing the average. If he gives 6-8 quizzes, the two lowest grades get dropped. He also gives letter-grades based on an X,Y,Z scale where X represents an average score less than 80% (failing) and Z represents an average score greater than 90% (distinction). Any other grade is a Y (passing). Write a function called findGrade (grades) that takes a list of quiz grades (grades) and returns the average and a letter grade based on Dr. Phloog's criteria. Your program must exclude the appropriate number of low grades, properly compute the average and the correct letter grade. I have provided a template for testing your function once you have developed it. USE THE TEMPLATE. SOME HINTS: 1. You should use floor division (//) on the length of the list to determine how many grades to exclude. 2. To exclude the lowest grades, begin by using the list sort () method. Then slice the list above the number of grades you wish to exclude. 3. To compute the average, iterate through the remaining grades and update a sum variable with each item. After having computed the sum, compute the average by dividing by the list length. 4. Simple comparisons are all that is necessary to find the letter grade from the average. 5. Note that in the template, two values are returned in parentheses. The parentheses form a "tuple" it is like a list but is "immutable". Program to calculate grades for Dr. Phloog 80.00Y 75.00X 91.86> Z 79.86X 85.17Y

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 Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions