From 1d76ed6daad6c50085a4014643dee71288751a24 Mon Sep 17 00:00:00 2001 From: deyanpeev Date: Wed, 14 Dec 2022 18:50:49 +0200 Subject: [PATCH] Task definition --- Seminar 7/task.md5 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Seminar 7/task.md5 diff --git a/Seminar 7/task.md5 b/Seminar 7/task.md5 new file mode 100644 index 0000000..32aff50 --- /dev/null +++ b/Seminar 7/task.md5 @@ -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 caller 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. \ No newline at end of file