start bus ex

This commit is contained in:
waldek 2021-11-15 16:25:17 +01:00
parent aaba561e05
commit f3441e1b94
1 changed files with 43 additions and 0 deletions

View File

@ -1449,6 +1449,8 @@ for friend in friends:
print("{} closes the door behind him...".format(friend.capitalize()))
```
**TODO pizza function with multiple arguments**
# Coding challenge - Cheerleader chant
Can you make me a program that outputs this type of cheerleader chant?
@ -2166,6 +2168,47 @@ for dog in all_my_dogs:
Think of some other world objects you can create a class for and do so.
The first one that comes to mind is vehicles but you can do anything that makes sense to you.
# Coding challenge - Bus line
There is a bus line with with 20 stops on it.
At each stop there are a number of people waiting according to the table below.
Throughout the day 4 buses will pass by and each bus has 30 seats on it.
* How many people are left at each stop at the end of the day?
* How many buses would the bus line need in order to get everybody to the terminal?
* What if at each stop 10% of the people on the bus get off?
| bus stop | people waiting |
|-------------------|----------------|
| 1 | 6 |
| 2 | 5 |
| 2 | 3 |
| 3 | 10 |
| 4 | 14 |
| 5 | 3 |
| 6 | 5 |
| 7 | 7 |
| 8 | 4 |
| 9 | 12 |
| 10 | 14 |
| 11 | 9 |
| 12 | 2 |
| 13 | 1 |
| 14 | 5 |
| 15 | 12 |
| 16 | 4 |
| 17 | 3 |
| 18 | 8 |
| 19 | 12 |
| 20 | 1 |
<details>
<summary>Spoiler warning</summary>
**TODO**
</details>
## Class inheritance
Inheritance is one of the four main pillars of Object Orientated Programming.