Ask Question
10 September, 20:42

OCR Land is a theme park aimed at children and adults. Entrance tickets are sold online. An adult ticket to OCR Land costs £19.99, with a child ticket costing £8.99. A booking fee of £2.50 is added to all orders. One ride in OCR Land has a minimum height of 140 cm to ride alone or 120 cm to ride with an adult. Create an algorithm that: • asks the user to input the height of the rider, in centimetres • if needed, asks if they are riding with an adult • outputs whether or not they are allowed to ride • repeats this process until 8 people have been allowed to ride

+3
Answers (1)
  1. 10 September, 23:34
    0
    count = 0

    while count! = 8:

    height = float (input ("Enter height of the rider: "))

    if height > = 140:

    print ("You are allowed to ride")

    count + = 1

    else:

    if height > = 120:

    answer = input ("Is the rider with an adult (yes/no) : ")

    if answer = = "yes":

    print ("You are allowed to ride")

    count + = 1

    else:

    print ("You are not allowed to ride")

    else:

    print ("You are not allowed to ride")

    Explanation:

    Initialize the count as 0, it will count the number of people allowed to ride

    Create a while loop that iterates while count is not equal to 8

    Inside the loop, ask the user for the height. If the height is greater than or equal to 140, print "You are allowed to ride" and increment the count by 1. Otherwise, check if the height is greater than or equal to 120. If it is not, print "You are not allowed to ride". If it is, ask if the rider is with an adult or not. If it is not, print "You are not allowed to ride". If it is print "You are allowed to ride" and increment the count by 1.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “OCR Land is a theme park aimed at children and adults. Entrance tickets are sold online. An adult ticket to OCR Land costs £19.99, with a ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers