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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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