Week 29 - OOP Programming homework

Week 29 - OOP Programming homework

by Dal Sandhu -
Number of replies: 0
Please complete the  Predator Prey UML class diagram (available here: UML Exercise File) and upload to the UML Exercise Upload Assignment before your programming lesson next week.

If you did not complete complete last week's programming OOP assignment then you must complete it over the weekend or before your first theory lesson next week, at the latest. Details are below.


OOP practice video: https://youtu.be/JeznW_7DlB0
Instructions:
  • This video is a really nice intro to OOP in Python. There is no need to go beyond 40 minutes and 50 seconds (unless you are interested).
  • You should follow the first half of the video and then write code that creates a Student and a Course class, as shown in the video.
  • Add another method to the Course class called get_maxgrade and write the code so it returns the maximum grade.
  • Then write code that creates a course object called "Computer Science", adds three student objects with their grades, and then prints the maximum grade by calling the get_maxgrade method of the course object.

Next, watch the second part on inheritance, and replicate the PetCatDog class definitions, add an additional attribute called breed, and include that in the output of the show method.

Please add your code and output to an EAD and upload it to the Week28 Dal Hmwk Assignment

Message me in Teams if you are confused by the content or unable to get your code working.