Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hackerrank.com / test / 7 h 5 i 7 skamti / questions / 2 ioa If the student's age is greater than 1 5 .
hackerrank.comtesthiskamtiquestionsioa
If the student's age is greater than the grade should be "High School",
Create another class School with the following attribute:
student list of type list.
containing Student objects
Implement the method for the School class. This method should take a list of Student objects as an argument and initialize the studentlist attribute with the provided list.
Create a method inside the School class called assigngrades. This method should call the calculategrade method for each student in the student ist and set their studentgrade attribute accordingly.
Define another method in the School class called getstudents bygrade. This method should take a string representing the grade le: si "Elementary", "Middle School": or "High School' as input and retum a list of student names tho belons to that grade. The search should be case insensitive.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started