Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

4. Identify the challenges facing todays organizations

Answered: 1 week ago