Write a function that computes a taxi fare.

Assignment Help Programming Languages
Reference no: EM13935492

1. Write a function that computes a taxi fare. In some cities, taxi fares are calculated based on start and end zones plus a per-minute charge. In this city, there are three zones (1, 2, and 3) and a graduated scale for time. Thus, your function should receive three parameters: the starting zone, the ending zone, and the time of the ride. It should return the total fare for the ride.

Use the following table for your calculations:

Start zone End zone    Base charge
1               1               $5.00
1               2                $7.00
1               3                $8.00
2               1                 $7.00
2               2                 $5.00
2               3                  $9.00
3               1                  $8.00
3               2                  $9.00
3               3                  $5.00

Time is more than But is not over Charge

0 minutes 4 minutes $0.75 per minute

4 minutes 10 minutes $3.00 plus $0.50 per minute over 4 minutes

10 minutes 20 minutes $6.00 plus $0.40 per minute over 10 minutes

20 minutes No limit $10.00 plus $0.30 per minute over 20 minutes

Reference no: EM13935492

Questions Cloud

Create a script that requires your visitors to accept : If the check box is not selected, display an alert dialog box information the user that he or she must accept the terms. if the user clicks the Decline link, open the Declinepage.html document.
Should world bank in charge of providing finance for exports : Forfaiting. What is forfaiting? Specify the type of traded goods for which forfaiting is applied. Should the World Bank be in charge of providing finance for exports?
Describe the seven fires of creation : What are your most outstanding learnings in this course so far and how does this knowledge enhance your appreciation and understanding of Native people and culture?
Determine the moment about of this tension : Determine the moment about O of this tension as applied to point A of the slender bar - determine the angle () which causes the most severe bending strain.
Write a function that computes a taxi fare. : Write a function that computes a taxi fare. In some cities, taxi fares are calculated based on start and end zones plus a per-minute charge. In this city, there are three zones (1, 2, and 3) and a graduated scale for time. Thus, your function shou..
Inherently insecure for sensitive professional : Networks are inherently insecure for sensitive professional and personal data. Still we use networks for sharing data. How to deal with protecting data in an insecure network environment that is the topic of discussion of this report. In this repo..
Organisations operating in a global market : What trends do you think are impacting HR today for organisations operating in a global market?
What motivates a government to establish in credit markets : Government programmes. What motivates a government to establish/intervene in the credit markets? Impact of a financial crisis. What steps should Brunch take if a crisis occurs in country X which is a major exporting destination for Brunch Ltd?
Create a trade crisis between the uk and russian firms : Explain how the cancellation of the L/C could create a trade crisis between the UK and Russian firms. how an irrevocable L/C would normally facilitate the business transaction between the Russian importer and Channel Traders.

Reviews

Write a Review

Programming Languages Questions & Answers

  Design program to calculate amount of money spend

Design a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day.

  Write a program that uses a random number generator

Write a program that uses a random number generator to generate a two digit positive integer

  Supporting activity and security personnel

Write a 100- to 200-word short-answer response for the following: Supporting Activity: Security Personnel. Do you think that security personnel require specific skills. Should security practices by an organization be used to prevent the misuse of ..

  Program which accepts candy name-price per pound

A program which accepts the candy name (for example, "chocolate-covered cherries"), price per pound, and number of pounds sol in average month, and displays item's data only if it is best-selling item.

  Show the total monthly cost of the expenses

Write a program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile:

  Write program to accept a list of student-s name

Write a program that will accepts a list of student's name, individual scores for quiz1, quiz2 and quiz3. Your program should then compute for the average of 3 quizzes.

  Develop application for company having breakdown of payroll

Develop the logic for application for company which wishes report containing breakdown of payroll by department. Input comprises each employee's name, department number.

  Program to display the bonus

product receives a 5% bonus, otherwise, he receives a 4% bonus. Display the bonus, formatted with a dollar sign and two decimal places, in the bonusLabel.

  Pascal random number generator

Your assignment is to explore the behavior of your Pascal random number generator by throwing random numbers between 20001 and 380000 (inclusive)

  Writing code in client program to enter score

Write down code in a client program to perform the following: prompt user to enter score and set score data member for player1.

  Develop the payroll program to enter two double values

Develop the payroll program named CalcPay which permits the user to enter two double values namely hours worked and hourly rate.

  Example on substitution model

Use the substitution model to illustrate what the result of calling (add1-iter '(1 2 3)) will be.  Why is the list reversed?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd