Object-Oriented Programming Activity: Python Digital Pets Game
Downloaded: 1325
Last edit: 10 January 2024
A Python translation of Austin Henley's original Java homework task, shared with permission and with thanks to the original author.
Skeleton Python code is provided that runs a basic digital pets game with actions such as Eat and Exercise. Tasks are provided that require students to extend the game by adding more pet species, more actions, and editing the main() program code, using key principles of object-oriented programming, including:
- changing attribute access modifiers (name mangling)
- implementing and using a constructor method
- implementing and using getters and setters
- using inheritance to create subclasses
- abstract methods
- static methods
- linking objects through association (composition)
Code is commented and the tasks are embedded in the comments.
I am currently not providing Task 2 answer code publicly as this is an assessed homework but can send via email upon request.
Edit history
Nela Brockington | 10.01.24
Allow commenting.
Nela Brockington | 20.04.22
Fixed typo in description.
Nela Brockington | 20.04.22
Minor edit to activity description.
Nela Brockington | 20.04.22
Minor edit to activity description.
Nela Brockington | 20.04.22
Added answer code for Task 1 A, B, C.
Nela Brockington | 20.04.22
Minor edits to activity description.
Nela Brockington | 20.04.22
Minor edit to title and description.
Nela Brockington | 20.04.22
Initial creation
Unlock all resources and events
To access our full library of resources and events create a free account today or login.
If you like this resource make sure you add it to your resource collection to access again or share with the community.
Login Create Account
Discuss: Object-Oriented Programming Activity: Python Digital Pets Game (2022-04-20)
Please login to post a comment