Question
Question 1: Taxi Fare Estimator You are asked to develop a taxi fare estimator for a Montreal taxi company. Users who are interested in receiving
Question 1: Taxi Fare Estimator
You are asked to develop a taxi fare estimator for a Montreal taxi company. Users who are interested in receiving taxi service may use the estimator to get a quote for a ride. The taxi company offers ride service in Greater Montreal Area. There are a few factors that determine the taxi fare for a ride, i.e., car model, distance, whether or not the ride time is within rush hours. There are two types of cars that may provide ride service: base car models and limo car models. Depending on which rush hours the taxi service is provided, the fare will increase accordingly. In short, the total fare equals to the fare per km for each car model times ($/km) the estimated distance (km) times a rush hour ratio (%).
- For base car model, the fare per km is $0.81; - For limo car model, the fare per km is $1.55; - If the ride is on any weekdays, there are three rush hour ratios that may apply:
o If between 8am and 10am or between 4pm and 5pm, the rush hour ratio is 1.5;
o If between midnight (12am) and 6am, the rush hour ratio is 2;
o For the remaining time, the rush hour ratio is 1. - If the ride is on weekend, there are two rush hour ratios that may apply:
o If between midnight (12am) and 6am, the rush hour ratio is 2; o For the remaining time, the rush hour ratio is 1.3.
Below are two sample outputs to demonstrate the expected behavior of your program. Note:
-
User input is highlighted in green.
-
Your program must display the same information but can be formatted differently.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started