Entry Fees Calculator using a Flowchart

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:

Video Tutorial

Watch the video tutorial for step by step instructions on how to complete this challenge.

First you will design the flowchart for your algorithm. The aim is your algorithm is to:

• 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.

 Test # Type of Test Input Values Expected Output Actual Output #1 Valid Adults: 2Children: 1 Total Cost: £41 #2 Valid Adults: 1Children: 0 Total Cost: £15 #3 Valid Adults: 2Children: 3 Total Cost: £59.85 #4 Valid Adults: 5Children: 12 Total Cost: £196.65 #5 Valid Extreme Adults: 0Children: 0 Total Cost: £0 #6 Erroneous Adults: abcChildren: xyz Error Message

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.

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:

Did you like this challenge?

Click on a star to rate it!

Average rating 3.8 / 5. Vote count: 16

No votes so far! Be the first to rate this post.

As you found this challenge interesting...