Question: In Python, create a Computer class with processor_name, storage, and RAM_capacity instance attributes. This Computer class also has a method called price() which calculates and
In Python, create a Computer class with processor_name, storage, and RAM_capacity instance attributes. This Computer class also has a method called price() which calculates and returns the price based on the RAM _capacity. The default price of any computer is RAM_capacity * 100. Now, create a Laptop child class that inherits from the Computer class. If Computer is Laptop instance, we need to add an extra 10% on price. So the total price for Laptop instance will become the final amount = total price + 10% of the total price.
Note: If the laptop RAM capacity is 16GB, so the final price amount should be 1760. You need to override the price() method of a Computer class in Laptop class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
