Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Join our platform to connect with experts ready to provide precise answers to your questions in different areas. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

Write an algorithm to:

1. Take as input the number of hours the user has parked and whether their car is electric or not.
2. Calculate and output the total price.
3. Repeat continually until the user enters 0 hours.

Note: The hotel car park charges £4 per hour. If the car is electric, this price is halved to £2 per hour.

You must use either:
- OCR Exam Reference Language, or
- A high-level programming language that you have studied.


Sagot :

Final answer:

Provides an algorithm to calculate parking charges based on hours parked and car type.


Explanation:

Algorithm:

  1. Take as input the number of hours the user has parked and whether their car is electric or not.
  2. Calculate the total price based on the parking duration and car type.
  3. Repeat the process until the user enters 0 hours.

Learn more about Parking charges algorithm here:

https://brainly.com/question/33323210