Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions 37 Seminar 7/task.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Computer mini program

Create a mini program that works with the following class definitions:
## Computer
### Attributes
* cpu - number value
* memory - number value
* storage - number value

### Methods
Create constructor and override the __str__ method to print all the parameters listed.

## Laptop
Should inherit the computer and add the following:
### Attributes
* gpu - number value
### Methods
* play_game - if gpu is greater than 2 - print "Playing a game". Otherwise, print "Unable to perform operation."
* design - if gpu is greater than 1 - print "Designing". Otherwise, print "Unable to perform operation."

The memory of the laptop should be able to be changed - create a property for it.

## Smartphone
Should inherit the computer and add the following:
### Attributes
* cellular - string value
* phone_number - string value
### Methods
* make_phone_call - the method should take a parameter <i>caller</i> and print "{phone_number} is calling {to_number}"
* receive_phone_call - the method should print "{phone_number} is receiving a call"

## GamingLaptop
In the inicialization of this class it should set the GPU value to 5.
### Methods
* play_extreme_game - just print "Playing an extreme game".

Each values should be set in the constructors. The constructor of each child class should reuse its parant's.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.