1 - Student class Make a class student (in student.py) that stores the following information for a student: Name (name) Student number (student_nr) Points per assignment (points_per_assignment) Exam grade (exam_grade) a) Behind each point of information is the name of the parameter to the initializer method. Store this information from the parameters in the object attributes with the same name.   b) Add a method course_points() which returns the number of course points the student has gotten. Example: mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)print(mary.course_points()) > 121 The calculation of the course points is explained in the course overview, course setup slides (Links to an external site.) and the first lectureLinks to an external site.. c) Add a method grade() which returns a the final grade of the student, rounded to nearest half (upwards, 6.75 -> 7). As per regulations, a 5.5 becomes a 6. If the student did not pass both the assignments (>= 95 course points) and the exam (exam grade >= 5.5), then the grade is "NVD" (niet voldaan = not fulfilled).  For example: mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)print(mary.grade()) > 9.5joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)print(joe.grade()) > "NVD" d) Add a method result() which gives the final result of the student for the VU administration. For example: mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)print(mary.result()) > Mary (15789613) has scored 9.5 on X_401096joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)print(joe.result()) > Joe (15789688) has scored NVD on X_401096 e) Add a method passes() that returns if a student passes the course. mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)print(mary.passes()) > Truejoe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)print(joe.passes()) > False f) Implement the method a.scores_higher_than(b) that determines if student a scores higher than student b. A student scores higher than another student if their grade is higher (any grade is higher than "NVD"). If students a and b have the same grade, then neither does a score higher than b, nor the other way around.  mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)joe.scores_higher_than(mary)> False g) Make a class Class (as in a class of students, not a class as in a class of objects) that stores several Student objects. Store a list of students in an attribute called students. The initializer method should initialize the class as an empty class (no students). Implement a method add_student() that takes an object of class Student and adds it to class. Implement method pass_rate() that determines the fraction of students that pass the class (have a grade of >= 6).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1 - Student class

Make a class student (in student.py) that stores the following information for a student:

  • Name (name)
  • Student number (student_nr)
  • Points per assignment (points_per_assignment)
  • Exam grade (exam_grade)

a) Behind each point of information is the name of the parameter to the initializer method. Store this information from the parameters in the object attributes with the same name.  

b) Add a method course_points() which returns the number of course points the student has gotten. Example:

mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)
print(mary.course_points())
> 121

The calculation of the course points is explained in the course overview, course setup slides (Links to an external site.) and the first lectureLinks to an external site..

c) Add a method grade() which returns a the final grade of the student, rounded to nearest half (upwards, 6.75 -> 7). As per regulations, a 5.5 becomes a 6. If the student did not pass both the assignments (>= 95 course points) and the exam (exam grade >= 5.5), then the grade is "NVD" (niet voldaan = not fulfilled).  For example:

mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)
print(mary.grade())
> 9.5

joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)
print(joe.grade())
> "NVD"

d) Add a method result() which gives the final result of the student for the VU administration. For example:

mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)
print(mary.result())
> Mary (15789613) has scored 9.5 on X_401096

joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)
print(joe.result())
> Joe (15789688) has scored NVD on X_401096

e) Add a method passes() that returns if a student passes the course.

mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)
print(mary.passes())
> True

joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)
print(joe.passes())
> False

f) Implement the method a.scores_higher_than(b) that determines if student a scores higher than student b. A student scores higher than another student if their grade is higher (any grade is higher than "NVD"). If students a and b have the same grade, then neither does a score higher than b, nor the other way around. 

mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)
joe = Student("Joe", 15789688, [10, 9, 8, 10, 5, 10], 5)
joe.scores_higher_than(mary)
> False

g) Make a class Class (as in a class of students, not a class as in a class of objects) that stores several Student objects. Store a list of students in an attribute called students. The initializer method should initialize the class as an empty class (no students). Implement a method add_student() that takes an object of class Student and adds it to class. Implement method pass_rate() that determines the fraction of students that pass the class (have a grade of >= 6).

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY