Question: You have to write a simple ride sharing (like Uber or Pathao) program in C language, but a miniature version. There are three types of
You have to write a simple ride sharing (like Uber or Pathao) program in C language, but a miniature version. There are three types of transportation options - car, motorcycle and bicycle. The bill is calculated as follows: 1. Base fare (Every ride starts with this amount): a. Car: 50 Taka b. Motorcycle: 30 Taka c. Bicycle: 20 Taka 2. Distance fare: a. Car: 25 Taka / km b. Motorcycle: 15 Taka / km c. Bicycle: 10 Taka / km 3. Duration fare: 2 Taka/minute 4. Total fare = Base fare + Distance fare + Duration fare 5. Promo fare: Promo code is applied on the total fare. There can be two types of promo: 1. Flat: flat 50 taka discount 2. Percent: 10% discount
Lets assume that we live in an ideal city where the vehicles move in a constant speed. Car: 60km/hour Motorcycle: 70km/hour Bicycle: 20km/hour
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
