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

  Dtproperties and sysdiagrams

Exclude the tables “dtproperties” and “sysdiagrams”. List the column CountOfTable, in which the Table is the chosen table name.

  Lottery requires that you select six different numbers

A lottery needs that you select six different numbers from the integers 1 to 49. Write a Java program that will do this for you and generate five sets of six numbers as a result.

  Examine the process of formal software testing

examine software testing as a career path, and consider what skills would be desirable for a software tester.

  How agile processes adapt to embrace

Explain the difference between change control and version control.

  Graphical user interface that calculates and displays

Write down a Java program without a graphical user interface that calculates and displays the mortgage payment amount given the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage.

  Implementing the client program

Write down a code in the client program to perform the following: Declare an object player1 of type Player.

  Define difference between a shallow copy and a deep copy

Overload the operator += for the class newString to perform the following string concatenation; suppose that s1 is "Hello" and s2 it "there". Then the statement s1 += s2; should assign "Hello there" to s1, where s1 and s2 are newString objects.

  Find out the correct solution

if the percentage of the correct answers is 75% of the 10 questions, then it would take us to the next level from 7 to 9. it continues to next level from 10 to 60 and thne next level from 70 to 90.

  Express the topic of "ownership of information"

give a code for information technologists with the topic of "ownership of information" designed to provide ethical guidelines in that area.

  What is an information system

What is an information system and why are they important? Can u please give me some examples. I am totally clueless on this subject. Is it possible to use information technology to gain a competitive advantage.

  Implementing the transactions using sql

Write down the complete transaction utilizing the SQL. Write down the full transaction log

  Write an essay on wifi performance

Write an essay on WiFi performance

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