Computers and Technology, 03.03.2020 06:09, soupsah7304
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 '''
Answers: 2
Computers and Technology, 23.06.2019 18:30, emmaishere69
List 3 items that were on kens resume that should have been excluded
Answers: 1
Computers and Technology, 23.06.2019 19:30, 123iamthe1
You can apply several different worksheet themes from which tab?
Answers: 1
Computers and Technology, 24.06.2019 01:00, arturocarmena10
The initial tableau of a linear programming problem is given. use the simplex method to solve it. x 1 x 2 x 3 s 1 s 2 z 1 2 4 1 0 0 8 3 4 1 0 1 0 10 minus3 minus12 1 0 0 1 0 the maximum is nothing when x 1equals nothing, x 2equals nothing, x 3equals nothing, s 1equals3, and s 2equals0. (be sure to simplify to lowest terms if necessary.)
Answers: 2
You're helping Professor Joy to calculate the grades for his course. The way his course is organised...
Arts, 11.11.2020 02:40
Mathematics, 11.11.2020 02:40
Biology, 11.11.2020 02:40
Mathematics, 11.11.2020 02:40
Geography, 11.11.2020 02:40