Following the success of her basic taxi service and the fact that a number of customers are using the service regularly, Allo taxi has decided to reward regular customers by allowing them to pay their bills on a monthly basis rather than for each individual journey.  This means that a series of discounted rates can be offered to customers who use the service on a regular basis. The customer will pay fares based on the frequency they use the service (the number of journeys made in a month) and the number of miles traveled in the month.  The Basic Charge (based on the total number of miles) is calculated according to the table below: Basic charges per mile ($): Up to 5 journeys Up to 10 journeys More than 10 journe

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Following the success of her basic taxi service and the fact that a number of customers are using the service regularly, Allo taxi has decided to reward regular customers by allowing them to pay their bills on a monthly basis rather than for each individual journey.  This means that a series of discounted rates can be offered to customers who use the service on a regular basis. The customer will pay fares based on the frequency they use the service (the number of journeys made in a month) and the number of miles traveled in the month.  The Basic Charge (based on the total number of miles) is calculated according to the table below:

Basic charges per mile ($):

Up to 5 journeys

Up to 10 journeys

More than 10 journeys

Up to 100 miles

1.00

0.85

0.70

Up to 250 miles

0.75

0.60

0.45

Over 250 miles

0.50

0.45

0.40

 

Note that the charges listed are per mile for the total number of miles traveled in the month. Note also that “Up to …” in this table implies “Up to and including”.  In addition, individual journeys above 20 miles will involve the driver having to spend time traveling back to their base before picking up their next fare so these journeys are therefore subject to a Surcharge of $6.50 per journey (in addition to the basic charge above).

For example, in the period of a month, a customer makes the following journeys:

Journey Description

Distance of Journey (miles)

Ashrafieh to Manarah

3

Beirut to Naameh

15

Naameh to Beirut

15

Beirut to Saida

45

Beirut to Damour

18

Beirut to Kalamoun

75

 

Totaling this up we have 6 journeys, with a total distance of 171 miles.  Looking this up in the table gives us a charge per mile of $0.60 which gives a Basic Charge for the month of 171 x 0.60 = $102.60

In addition, we have 2 individual journeys (Beirut to Saida and Beirut to Kalamoun) which are greater than 20 miles so we need to add an additional Surcharge (6.50 per journey) of $13.00.

The charge to the user will therefore be the sum of the Basic Charge and the Surcharge, which in this case is $115.60 (102.6 + 13.00).

TASK

You are required to DRAW A FLOCHART to calculate the charges for a customer’s monthly taxi bill, based on the description above. 

Notes and Hints

  • Your flowchart should require input only of journey distances.

 

  • You should obtain the number of journeys and the number of journeys requiring the additional surcharge from the distances entered. You should NOT ask the user to input separately the number of journeys ordered.

 

  • You should continue to accept input of journey distances until the user indicates that no more journeys are required by entering a journey distance of 0 miles.

 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY