b. [25] Your goal is to write functions that act on a dictionary containing the names...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
b. [25] Your goal is to write functions that act on a dictionary containing the names of students as keys, and their exam score as the values. An example dictionary is as follows: {'Kathy': 68, 'Mira': 94, 'Brian': 44, 'Fred': 90} i) A function Make Average () that takes such a dictionary as a parameter and returns the average score in the class. (You are NOT allowed to use any built-in functions that compute the average or sum of values) ii) A function FindStars () that takes such a dictionary as a parameter and returns a list containing students that scored 90 or higher iii) A function GradeBook () that takes such a dictionary as a parameter and returns another dictionary whose keys are the names of the students and the values are "EXCELLENT", "PASS", or "FAIL" determined as follows: FAIL if the exam score <50 PASS if the exam score >= 50 but <90 EXCELLENT if the exam score >= 90 b. [25] Your goal is to write functions that act on a dictionary containing the names of students as keys, and their exam score as the values. An example dictionary is as follows: {'Kathy': 68, 'Mira': 94, 'Brian': 44, 'Fred': 90} i) A function Make Average () that takes such a dictionary as a parameter and returns the average score in the class. (You are NOT allowed to use any built-in functions that compute the average or sum of values) ii) A function FindStars () that takes such a dictionary as a parameter and returns a list containing students that scored 90 or higher iii) A function GradeBook () that takes such a dictionary as a parameter and returns another dictionary whose keys are the names of the students and the values are "EXCELLENT", "PASS", or "FAIL" determined as follows: FAIL if the exam score <50 PASS if the exam score >= 50 but <90 EXCELLENT if the exam score >= 90
Expert Answer:
Answer rating: 100% (QA)
Required code for the python program is given below with explanatory comments Text format of code fo... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
class Queue using no other data structures than Item, Boolean, int and Stack. The amortized running time of each Queue meth od must be constant. (Note that you may only use the Stack as a black box:...
-
(a) Use the following text to derive distributions for rat and chased. Use a five-word window, including open- and closed- class words, ignore case, punctuation and sentence boundaries and weight...
-
Verify that the functions are probability density functions for a continuous random variable X over the given interval. Determine the specified probability. f(x) = xe over [0, ), P(1 X 3)
-
Under what circumstances will a partner who is leaving a partnership give the remaining partners a bonus?
-
A get retardation assay can be used to determine if a protein bids to a segment of DNA. When a segment of DNA is bound by a protein. Its mobility will be retarded, and the DNA band will appear higher...
-
Reconsider Problem 56. Determine which oven should be purchased based on an incremental annual worth analysis. Data from problem 56 Octavia Bakery is planning to purchase one of two ovens. The...
-
a. Armstrong County established a County Office Building Construction Fund to account for a project that was expected to take less than one year to complete. The Countys fiscal year ends on June 30....
-
About a year and a half ago, your parents purchased some appliances at a major retailer, taking advantage of a "no payments and no interest offer. Under the agreement, for 18 months no interest would...
-
Are there any engineering positions you would be unwilling to take for ethical reasons? (e.g. Specific sectors of industry, or specific firms). a.Why or why not? (Name 1-2 sectors/firms and explain...
-
If the cost function for John's Shoe Repair is \(C(q)=100+10 q-q^{2}+\frac{1}{3} q^{3}\), and its marginal cost function is \(M C=10-2 q+q^{2}\), what is its profit-maximizing condition given that...
-
Each firm in a competitive market has a cost function of \(C=q^{2}\), so its marginal cost function is \(M C=2 q\). The market demand function is \(Q=24-p\). Determine the long-run equilibrium price,...
-
Question 3.16 asked about the effect of imposing a specific tax on a perfectly competitive industry when entry into the industry is limited. If entry were instead unlimited, how would the market and...
-
Suppose that the demand curve for wheat is \(Q=100-10 p\) and the supply curve is \(Q=10 p\). The government provides producers with a specific subsidy of \(s=1\) per unit. a. How do the equilibrium...
-
Airport owners grant airlines the right to schedule a landing or departure during a specific period of time in accordance with guidelines set out by the International Air Transport Association. Once...
-
A company is considering building a new and improved production facility for one of its existing products. It would be built on a piece of vacant land that the firm owns. This land was acquired four...
-
Listed below are common types of current liabilities, contingencies, and commitments: a. Accounts payable b. Bank loans and commercial paper c. Notes payable d. Dividends payable e. Sales and excise...
-
Write a loop that counts the number of alphanumeric characters (letters or digits) that appear in the string referenced by mystring.
-
Draw an IPO chart that documents the input, processing, and output of the built-in input function.
-
This is the first index in a string. a. 1 b. 1 c. 0 d. The size of the string minus one
-
Describe how competence, caring, and character affect your credibility as a communicator.
-
Explain the importance of establishing credibility for business communications.
-
Define and explain business ethics, corporate values, and personal values.
Study smarter with the SolutionInn App