subject

You're helping Professor Joy to calculate the grades for his course. The way his course is organised, students take two exams and their final grade is the weighted average of the two scores, where their lowest score weights 70% and their highest score 30%.

To accomplish this, you are going to need to do the following:

(1) Build the Student named tuple with the following attributes:

name (string)
exam1 (float)
exam2 (float)
(2) Write a function create_student, which will ask the user to input a single student's name, exam 1 score, and exam 2 score. The function will then create a named tuple with this information and return it.

(3) Write a function create_class, which takes as input an integer n, calls create_student n times and returns a list with the n students created.

(4) Write a function calculate_score, which takes a single Student named tuple as input, and returns the final score, where their lowest grade is weighted 70% and their highest grade is weighted 30%.

(5) Print the value returned by calculate_score for each student created in main. Round each score to two decimal places (using round(value, 2)).

Example 1: if the input is:

1
Student 1
10
0
then the output is:

3.0
Example 2: if the input is:

2
Student 1
10
0
Student 2
7
8
then the output is:

3.0
7.3
Example 3: if the input is:

0
then the output is:

Code:

from collections import namedtuple

''' Build named tuple here '''

''' Write Functions Here '''

if __name__ == "__main__":
''' Call functions and print here '''

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
These statements describe lists in presentation programs: a. bullets can be turned off and on. b. bullets cannot be turned off. c. bullet styles, colors, and sizes can be changed. d. lists don't have to use bullets or numbers. e. numbering styles, colors, and sizes can be changed. f. numbers can be turned off and on. g. numbers cannot be turned off. select all that apply
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
Which describes careers that have similar education requirements but different qualifications? product safety engineers and materials engineers industrial safety engineers and industrial health engineers quality control systems managers and inspectors industrial safety and health engineers and hand packers
Answers: 3
question
Computers and Technology, 24.06.2019 18:20
Use a while-end loop in a script file to calculate the sum of the first n terms of the series: summation sign on the top n bottom k=1 : )^k * k^2 +5k)/3^k show the script file and the two results of n = 10 and n = 20.
Answers: 2
You know the right answer?
You're helping Professor Joy to calculate the grades for his course. The way his course is organised...
Questions
question
Mathematics, 31.01.2020 22:49
Questions on the website: 13722367