Python 3.5 URGENT HELP NEEDED Main.py https://pastebin.com/GGMQUsix Student.py h
ID: 3813191 • Letter: P
Question
Python 3.5
URGENT HELP NEEDED
Main.py
https://pastebin.com/GGMQUsix
Student.py
https://pastebin.com/DtQKeuzk
classlist.txt:
https://pastebin.com/aHJ7yHma
exam.txt:
https://pastebin.com/ZjKPsyv7
exam2.txt:
https://pastebin.com/QkDgAK2g
solution.txt:
https://pastebin.com/wHTfWYzV
All changes must be made to Main.py
It's very common to have to work around poor quality or corrupted data. Note that some lines of data in the text files of this assignment may be corrupted! For example, this line of data does not have enough answers:
N00000003:B,A,D,D,C
... and this line of data has too many answers:
N00000002:C,D,D,C,A,D,A,C,B,D,D,B,A,B,A,C,B,D,A,C,A,A,B,D,D,A,B,C,D,E
… and this line of data has some missing answers:
N00000003:C,A,,D,D,C,,A,B,D,A,B,C,,D
If you encounter a line of data that is un-usable you should print an error message to the user. However, you should try to mark those responses as much as possible.
Here's a sample running of this section for having not enough answers in the data file:
---------------------------------------------------
Enter your choice: 3
---------------------------------------------------
Enter name of the data file: exam5_10_e1.txt
Completed reading of file exam5_10_e1.txt
Not enough answers for ID: N00000003
Sum of marks: 20
...
N00000001: John, john@amail.com, marks: [5]
N00000002: Kelly, kelly@bmail.com, marks: [7]
N00000003: Nicky, nicky@cmail.com, marks: [1]
N00000004: Sam, sam@dmail.com, marks: [2]
N00000005: Adam, adam@amail.com, marks: [5]
Here's a sample running of this section for having too many answers in the data file:
---------------------------------------------------
Enter your choice: 3
---------------------------------------------------
Enter name of the data file: exam5_10_e2.txt
Completed reading of file exam5_10_e2.txt
Too many answers for ID: N00000002
Sum of marks: 19
..
N00000001: John, john@amail.com, marks: [5]
N00000002: Kelly, kelly@bmail.com, marks: [7]
N00000003: Nicky, nicky@cmail.com, marks: []
N00000004: Sam, sam@dmail.com, marks: [2]
N00000005: Adam, adam@amail.com, marks: [5]
You are required to complete the display_result(claslist) function which takes a class list and prints the marking result for all students in the class list. If the forth option of the menu, i.e., ‘Display the Marking Result’, is selected, the program should display the marking result.
Here's a sample running of this section using the “exam.txt” data file:
...
---------------------------------------------------
Enter your choice: 4
---------------------------------------------------
N00000001: John, john@amail.com, marks: [4]
N00000002: Kelly, kelly@bmail.com, marks: [5]
N00000003: Nicky, nicky@cmail.com, marks: [4]
N00000004: Sam, sam@dmail.com, marks: [6]
N00000005: Adam, adam@amail.com, marks: [4]
Here's a sample running of this section after TWO exams have been marked:
...
---------------------------------------------------
Enter your choice: 4
---------------------------------------------------
N00000001: John, john@amail.com, marks: [4, 5]
N00000002: Kelly, kelly@bmail.com, marks: [5, 7]
N00000003: Nicky, nicky@cmail.com, marks: [4]
N00000004: Sam, sam@dmail.com, marks: [6, 2]
N00000005: Adam, adam@amail.com, marks: [4, 5]
You are required to complete the display_summary(marks) function which takes a list of marks and prints the marking summary of the exam. If the fifth option of the menu, i.e., ‘Display the Marking Summary’, is selected, the program should display the marking summary of the exam. The function should compute the following statistics after you've done the marking of the exam:
* the total number of students represented in the data file
* the highest score
* the lowest score
* the average score (mean)
Here's a sample running of this section using the “exam.txt” data file:
...
---------------------------------------------------
Enter your choice: 5
---------------------------------------------------
Grade Summary:
Total number of Students: 5
Highest Score: 6
Lowest Score: 4
Mean: 4.6
Here's a sample running of this section using the “exam2.txt” data file:
...
---------------------------------------------------
Enter your choice: 5
---------------------------------------------------
Grade Summary:
Total number of Students: 4
Highest Score: 7
Lowest Score: 2
Mean: 4.75
Explanation / Answer
grade=[]
names=[]
highest=0
#taking number of calues
cases=int(input('Enter number of cases: '))
for case in range(1,cases+1):
print('case',case)
#taking number of students
number=int(input('Enter number of students: '))
for numbers in range (1,number+1):
#getting name and marks
name=str(input('Enter name of student: '))
names.append(name)
mark=float(input('Enter mark of student:'))
grade.append(mark)
print('Case',case,'result')
#printing the results!
average=float(sum(grade)/number)
print('Average is: %.2f '%(average))
print('Highest Score is: %.2f'%(max(grade)))
print('Student with highest score: ',names[grade.index(max(grade))])
sample output
Enter number of cases: 2
case 1
Enter number of students: 2
Enter name of student: josh
Enter mark of student:98
Enter name of student: sarah
Enter mark of student:87
Case 1 result
Average is: 92.50
Highest Score is: 98.00
Student with highest score: josh
case 2
Enter number of students: 3
Enter name of student: shania
Enter mark of student:78
Enter name of student: arleen
Enter mark of student:89
Enter name of student: zoya
Enter mark of student:89
Case 2 result
Average is: 147.00
Highest Score is: 98.00
Student with highest score: josh
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.