Question

In: Computer Science

question1: students' scores: mark: 81 john: 99 smith: 66 Meggie: 100 terry: 20 William: 65 a....

question1:

students' scores:

mark: 81

john: 99

smith: 66

Meggie: 100

terry: 20

William: 65

a. Modify the student's score program so that it reads the exam scores into a queue and prints the queue.

–Next, filter out any exams where the student got a score of 100.

–Then perform your previous code of reversing and printing the remaining students.

b. What if we want to further process the exams after printing?

Solutions

Expert Solution

n = input("Enter number of students:")
n = int(n)
names=[]
marks=[]
for i in range(n):
    names.append(input("\nEnter Name of student:"))
    marks.append(int(input("Enter Marks:")))
print("\n***Printing the Queue***")
print("Names = ",names)
print("Marks = ",marks)

print("\n***After removing exams with 100 marks**")
for i in range(n):
    if(marks[i]==100):
        marks.pop(i)
        names.pop(i)
print("Names = ",names)
print("Marks = ",marks)

Answer for part b

You can perform any further operations with the data as it is stored in the Queue. The only concern will be that ce cannot retain the data related to the exams with 100 marks as we have already deleted them.

Note:

The above question was a bit less informatory regarding what exact operations are to be performed. So if anything is not satisfactory then get back through comments and I will try to reply as soon as possible.

Thank you.


Related Solutions

Below you are given the examination scores of 20 students. 52 99 92 86 84 63...
Below you are given the examination scores of 20 students. 52 99 92 86 84 63 72 76 95 88 92 58 65 79 80 90 75 74 56 99 a). How many classes would you recommend? b). What class interval would you suggest? c). Develop a relative frequency distribution d). Develop a cumulative frequency distribution
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT