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 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Research data that is presented using descriptive language is said to be
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
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, 20.07.2019 17:00
question
Chemistry, 20.07.2019 17:00
Questions on the website: 13722367