Question
Old MathJax webview Old MathJax webview For this exercise, four files need to be created. Two will be used for subclass, with one to be
For this exercise, four files need to be created. Two will be used for subclass, with one to be used as the superclass, and to be used as this project main module.
File one (Superclass):
Create a file called game_inv.py, with a method named total_value, this new method will return user inputted value of the inventory, count multiplied by the cost of games inserted by the user into the input section. Use a _ _ str _ _ method which includes retail, and calls for the method to obtain that value. File two (Subclass):
Create a file with the name of game.py, and define a class with the name of game, which inherits from overallgames. Within the game class add an additional public instance variable in the form of a Boolean and call it disk. Total games should look like the following:
class overallgames: def __init__(self, game='', amount=0, total=0.0): self.game = game self.amount = amount self.unit_total = total
Use a _ _ init _ _ method which takes four arguments. These should include the three within overallgames (game, amount, and total), and add the disk we created in the previous step. Call the superclass _ _ init _ _ method which will initialize that the superclass variable, followed by the disk variable. Use a new variable called user_input, This should not take any arguments. It will also reverse methods within this superclass. This will fill in information from the game class we created in step one. Create a _ _ str _ _ method which is to return a string that holds any data within the object. File three (Subclass):
Create a new file with the name of code.py. Within this newly created file, define a new class with the named code that inherits from overallgames. Add two public instance variables. These should both be inputted as integers with the names of barcode, and dlc. This newly introduced instance dlc variable will indicate how many downloadable content packages are available. Use the numbers one through four to do so. Dlc only applies to code, and not game. Similar to what was done in game.py, reverse the superclass of _ _ init __, user_input, and also _ _ str _ _, methods. File four (Main module)
Create the final file and name it final_game.py. The following information should be inserted into this program: (Use objects in order to create and hold information shown below) Game type
Item Name
Item Count
Price
Type
Barcode
DLC
overallgames
controller
1
30.00
game
COD
4
20.00
disk
game
NHL
6
10.00
disk
code
FIFA
7
40.99
08
1
code
FORZA
6
25.00
09
4
After this is done, create two more objects which should ask for the user to input some new information. The user should be asked if they would like to create a code game, or overallgames. Also ask the user if the game type is disk or digital.
please do not copy and please provide full code
the question is complete please do accordingly nothing can be added in the question please solve it
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