For this challenge you will create a flowchart to explain the process that a computer will have to follow to calculate the entry fees to an aqua park for a small group of visitors or a family.
Below is the price list of the aqua park:
Task 1: Design the Flowchart
First you will design the flowchart for your algorithm. The aim is your algorithm is to:
- Ask the user how many adult tickets are needed,
- Ask the user how many child tickets are needed,
- Calculate the total cost of this order,
- Decide if this order qualifies for a 5% discount and if so, calculate the new total cost of the order,
- Output the total cost of the order.
Task 2: Python Code
Once your flowchart is complete, implement your algorithm using Python code.
Task 3: Test Plan
|Test #||Type of Test||Input Values||Expected Output||Actual Output|
|Total Cost: £41|
|Total Cost: £15|
|Total Cost: £59.85|
|Total Cost: £196.65|
|#5||Valid Extreme||Adults: 0
|Total Cost: £0|
Task 4: Adding extra validation routines
Tweak your code to add some validation routines when capturing user inputs. For instance, you want to make sure that the user only enters a positive integer value when asked for the number of tickets required.
You might find this blog post useful to ensure the user provides an integer value when asked to do so.
Adding validation routines when capturing user inputs is always a good approach to improve your programs and make them more robust.
You can investigate other forms of validation routines on this page.