|
8 | 8 | - Circumference = 2πr
|
9 | 9 | - Use the round() function to get the answer to 2 decimal places
|
10 | 10 |
|
11 |
| -3. Create a Vehicle parent class, initialise it with, wheels, colour and a method to display all this information. |
| 11 | +3. Create a Employee class and initialise it with name and staff number. |
| 12 | + - i. Make methods to: |
| 13 | + - display_info - It should display all the information of the employee. |
| 14 | + - set_department - It should assign the department to employee. |
| 15 | + - set_bonus - It should assign a bonus amount to the employee. |
| 16 | + |
| 17 | + - ii. Create the instance attributes first name and last name instead of name. |
| 18 | + - Create two methods full_name and email_address in the Employee class. |
| 19 | + - Given a person's first and last names: |
| 20 | + - Form the full_name method by simply joining the first and last name together, separated by a space. |
| 21 | + - Form the email_address by joining the first and last name together with a . in between, and follow it with @company.com at the end. Make sure everything is in lowercase. |
| 22 | + |
| 23 | + |
| 24 | +4. Create a Vehicle parent class, initialise it with, wheels, colour and a method to display all this information. |
12 | 25 | - i. Create a Tesla (or any car) child classs and add a method to get the miles and a method to display all this information.
|
13 | 26 | - ii. Change the colour of the vehicle.
|
14 | 27 | - iii. Delete the wheels.
|
15 | 28 |
|
16 |
| -4. Create a Employee class and initialise it with name and staff number. Make methods to: |
17 |
| - - display_info - It should display all the information of the employee. |
18 |
| - - set_department - It should assign the department to employee. |
19 |
| - - set_bonus - It should assign a bonus amount to the employee. |
20 | 29 |
|
21 | 30 | 5. Create the instance attributes fullname and email in the Employee class. Given a person's first and last names:
|
22 | 31 | - Form the fullname by simply joining the first and last name together, separated by a space.
|
|
0 commit comments