Question

In: Computer Science

AverageGrade. Assume the professor gives five exams during the semester with grades 0 through 100 and...

AverageGrade. Assume the professor gives five exams during the semester with grades 0 through 100 and drops one of the exams with the lowest grade. Write a program to find the average of the remaining four grades. The program should use a class named Exams that has

1. An instance variable to hold a list of five grades,

2. A method that calculate and return average.

3. A string that return the “exams Average” for printing.

Your program output should prompt for an input for each grade. Use any number between 0 and 100. Your submission should include compiled output.

Solutions

Expert Solution

Answer:- We are using Python 3 Programming language for this problem.

Python Program (Use Python 3 compiler for execute)

class Exams:
    instance=[] #An instance variable to hold a list of five grades
    # A method that calculate and return average.
    for i in range(5):
        a=int(input('Please Enter Grade: '))
        instance.append(a)
    instance = sorted(instance) # To sort string in ascending order
    Sum=0
    for i in range(1,5):
        Sum=instance[i]+Sum
    # A string that return the “exams Average” for printing.
    print('Exam average: ',Sum/4)

Output:-

If you need any help in understanding, Please comment your query.

I tried my best for this question, I hope you upvote my answer.

Thank You


Related Solutions

AverageGrade. Assume the professor gives five exams during the semester with grades 0 through 100 and...
AverageGrade. Assume the professor gives five exams during the semester with grades 0 through 100 and drops one of the exams with the lowest grade. Write a program to find the average of the remaining four grades. The program should use a class named Exams that has 1. An instance variable to hold a list of five grades, 2. A method that calculate and return average. 3. A string that return the “exams Average” for printing. Your program output should...
AverageGrade. Assume the professor gives five exams during the semester with grades 0 through 100 and...
AverageGrade. Assume the professor gives five exams during the semester with grades 0 through 100 and drops one of the exams with the lowest grade. Write a program to find the average of the remaining four grades. The program should use a class named Exams that has An instance variable to hold a list of five grades, A method that calculate and return average. A string that return the “exams Average” for printing. Your program output should prompt for an...
M12 Q21 Professor Gill has taught General Psychology for many years. During the semester, she gives...
M12 Q21 Professor Gill has taught General Psychology for many years. During the semester, she gives three multiple-choice exams, each worth 100 points. At the end of the course, Dr. Gill gives a comprehensive final worth 200 points. Let x1, x2, and x3 represent a student's scores on exams 1, 2, and 3, respectively. Let x4 represent the student's score on the final exam. Last semester Dr. Gill had 25 students in her class. The student exam scores are shown...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a...
Professor Fair believes that extra time does not improve grades on exams. He randomly divided a group of 300 students into two groups and gave them all the same test. One group had exactly 1 hour in which to finish the test, and the other group could stay as long as desired. The results are shown in the following table. Test at the 0.01 level of significance that time to complete a test and test results are independent. Time A...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT