Design a function that computes a taxi fare

Assignment Help Computer Engineering
Reference no: EM1332359

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: EM1332359

Questions Cloud

How will you become a more effective communicator : How will you become a more effective communicator and How can you express your feelings and emotions to individuals in the workplace
Elucidate the difference between a monopoly and an oligopoly : Elucidate the difference between a monopoly and an oligopoly, and a cartel. Provide an example of a monopoly, an oligopoly, and a cartel. Describe the welfare effects of monopolies and oligopolies.
Effectiveness of communication : What challenges do criminal justice professionals confront when they attempt to communicate with people who speak another language?
Question about emerging hr issues : Write a detailed analysis, explaining how these issues and cultural considerations affect your division and the strategic plans.
Design a function that computes a taxi fare : Write down 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.
Present value of all future earnings : You are running a hot internet company. Analysts predict that its earnings will grow at 30% for each year for the next five years. After that, as competition rises, earnings growth is expected to slow to 2% per year and continue at that level fore..
Explaining material factors and individualism of countries : What are the prevailing attitudes toward time, change material factors and individualism?
Illustrte what is the put premium : Illustrte what is the put premium on a December 25 PHLX pound contract with an exercise price of $1.81.
Drain on medicaid resources : Health Care Management - show alternatives to ease this drain on Medicaid resources and Show alternatives to ease this drain on Medicaid resources

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the specialization of Dottie's Tax facility

What is the specialization of Dottie's Tax facility At least 6 returns? (Round z-score computation to 2 decimal places and your final answer to 4 decimal places.)

  Program that stores and converts a number

Write down a program that stores and converts a number entered in Roman numerals to an integer value. Your program should consist of a class named Roman.

  What is microprocessor - motorola 68k assembly language

What is microprocessor - Motorola 68k assembly language? Implement your plan using a user vectored interrupt number 3. Use busy line from the printer to trigger the interrupt. The printer interrupt level is 2. Explain the extra hardware to make t..

  Program to evaluate case statement

Program to evaluate case statement

  Which data structure is the optimum one

When lots of inserts & deletes are involved. When you have no clue about how big the list would grow.

  How a box of caramel delites girl scout cookies

How to a box of Caramel deLites Girl Scout cookies Every spring you looking forward to buying a box of Caramel deLites Girl Scout cookies

  Write down one method containing string manipulations

Program should include a method for each element. Write one method containing String manipulations, one that includes if-else statements, and one that includes a switch.

  Writing into file utilizing fileinputstream

Write down an application utilizing the FileInputStream which opens a file which consists of the name of user's favourite book and then show it to the user.

  Organization to consolidate servers

Utilizing any organizational model from your experience and or research, describe the pros and cons of this organization in order to consolidate the servers and to relocate the primary data centers.

  Debate the moral responsibility of one agent

Debate the moral responsibility of one agent (Computer Programmer) associated with the two Therac-25 overdoses which occurred in Tyler, Texas.

  Describes a function named insidecircle

Describes a function named insideCircle

  Find the monthly amount of interest paid and remaining debt

You have just purchased a stereo system that costs $1000 on the following credit plan: no down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50.

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