Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program to simulate ubers method of calculating cost of ride INPUT Your program is to prompt the user for: - Riders first

Write a C++ program to simulate ubers method of calculating cost of ride INPUT Your program is to prompt the user for: - Riders first and last name in one prompt - the length of ride in minutes - the distance of ride in miles - code of 'X'for uberX ( Uber's budget option) or code of 'S' for SUV, or L for luxury car. - code for whether or not there is a surge for the trip. LetterY for yes and N for no. - if and only if code for surge is Y ask the user for the surger multiplier. CALCULATE Calculate the total fare as base fare + per minute x number of minutes + per mile x number of miles. If there is a surge fee then multiple the base fare by the surge fee before calculating total fare. If total fare is less than minium fee then total fare is set equal to minimum fare. Use the following fee schedule: Type of vehicle base fare per minute per mile Minimum fare UberX $ 2.00 $ 0.22 $ 1.15 $ 6.55 SUV $15.00 $ 0.90 $ 3.75 $ 25.00 Luxury $ 5.00 $ 0.50 $ 2.75 $10.55 OUTPUT A sample run might look like this: Enter enter time in minutes: 70 Enter enter distance: 55 Enter 'X' for uberX or 'S' for SUV or L for luxury: x Enter 'Y' if surge or N if not: Y Enter surge multiplier: 1.9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions