The story
Do you remember the “Cash or Credit” exercise? You were supposed to create a flowchart for the automated pricing of the Gym Carrey gym. Last week we tried to implement it in Scratch during our very first coding dojo…
Let’s create the same program, but this time in Python!
The gym Gym Carrey has the following price list:
- for sauna users, it’s 1500 HUF altogether
- for the ones who don’t intend to use the sauna, the following applies: (unless they are students):
- women: 500 HUF
- men: 750 HUF
- for students it’s 300 HUF (unless they use the sauna)
- below the age of 14, usage of the gym is forbidden
The exercise
Create the flowchart using draw.io
Create Python script - the requirements:
- Jim Carrey should ask yes/no questions.
- All Jim’s questions should be elements of list - script should display them based on stage.
- After asking enough questions he should tell you the price.
- Jim should be foolproof (able to handle stupid users).
If your script works, you can add some features:
- Jim should tell some random jokes after each answer.
- Use ASCII art for tickets and add both questions and answers should be colorful.