Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a function called farecalc that computes the bus fare one must pay in Lawrence MV Transit based on the distance travelled. Here is

image text in transcribed
1. Write a function called farecalc that computes the bus fare one must pay in Lawrence MV Transit based on the distance travelled. Here is how the fare is calculated: the first mile is $2 Each additional mile up to a total trip distance of 10 miles is 25 cents per mile. Each additional mile over 10 miles is 10 cents per mile. Miles are rounded to the nearest integer other than the first mile which must be paid in full once a journey begins. The input to the function would be the distance of the journey. Return the fare in dollars, e.g., 2.75 would be the result returned for a 4-mile trip

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

When there was controversy, was it clear who had the final say?

Answered: 1 week ago