Question: Class definition #1 Write a program which defines a class for cataloguing video games. The class should have three properties: the game name, the console
Class definition #1
Write a program which defines a class for cataloguing video games. The class should have three properties: the game name, the console name, and the year of production. All the properties are mandatory and must be provided.
Create 2 objects using the defined class. Provide the code below.
| Reply below (only code here): |
|
|
Now, make sure that all parameters are hidden and allow their retrieval with a getter method and their modification with a setter method.
Modify and display the properties of the two previously created objects. Provide the code below.
| Reply below (only code here): |
|
|
Create a method that provides the age of the video game by making a simple difference between the current year (2023) and the production year: game_age = curret_year production_year
In the previous code, use the method for calculating the game age for the two previously created objects.
Provide the code below.
| Reply below (only code here): |
|
|
Provide the screenshot of the run output (entire screen, no cuts).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
