Question: Write a Python program to accomplish the following tasks: A. Create a class named Hard Disk that includes the following: - three properties: hdCapacity, seekTime,

 Write a Python program to accomplish the following tasks: A. Create

Write a Python program to accomplish the following tasks: A. Create a class named Hard Disk that includes the following: - three properties: hdCapacity, seekTime, and type. - two methods: a) printData() that prints all harddisk's information. b) increaseHdCapacity () that takes one argument called cap. The method adds the value of cap to the hdCapacity property B. Create a class named Computer that includes the following: three properties: a) property named brand b) property named price c) property named hardDisk: The value of the hardDisk should be set by default as a composition of the Hard Disk class. - two methods: a) printData(): that prints all computer's information. b) getCost (): that return the cost of the Computer. (A) Create an object of type Hard Disk with hardDiskCapacity=40000, seekTime=5200, and type = SSD, and call printData and increaseHdCapacity methods (B) Create an object of type Computer with hardDiskCapacity=40000, seekTime=5200, and type = SSD, price =950, and brand=" Toshiba, and call printData method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!