Question: Write a Python program to accomplish the following tasks: Create a class named CPU that includes the following: - three properties: cacheSize, numOfCores, and type

Write a Python program to accomplish the following tasks:

  1. Create a class named CPU that includes the following:

- three properties: cacheSize, numOfCores, and type.

- two methods:

  1. printAll() that prints all cpus information.
  2. increaseCashSize () that takes one argument called size. The method adds the value of size to the Cache size.

B. Create a class named NoteBook that includes the following:

- three properties:

  1. property named brand
  2. property named cost
  3. property named cpu: The value of the cpu should be set by default as a composition of the CPU class.
  • two methods:
  1. printAll(): that prints all noteBooks information.
  2. getCost: that return the cost of the notebook

  1. Create an object of type CPU with cashSize =4, numOfCores =8, and type = Quad-core, and call printAll and increaseCashSize methods
  2. Create an object of type LapTop with cashSize =4, numOfCores =8, and type = Quad-core, cost=1100, and brand=Dell, and call printAll 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!