CJCoding With Joseph
15free / daySign inCreate account

Honour Student

Write two classes from scratch. Student(name, grades) stores name (a string) and grades (a list of floats) as typed attributes and has average() returning sum(self.grades) / len(self.grades). HonourStudent inherits from Student: its constructor takes the same two arguments and passes them to the parent with super().__init__(name, grades); is_eligible() returns True when the inherited average is 80 or more; describe() prints <name>: <average> (eligible) or <name>: <average> (not eligible), choosing with an if on is_eligible. Do NOT write a main block or any top-level test code; the tests construct the class. Input: two lines, a name and then grades separated by spaces, which the tests read (the grades as floats); they first print the average of a fixed plain Student, then build an HonourStudent from the input, call describe and print what is_eligible returns.

Expected Output:

85.0
Noor: 85.0 (eligible)
True

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
ClassesInheritance
📥 Auto-Input:
Noor\n88 92 75\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.