Question: Chapter 4 Route Time Assume a route between two points has several segments. Each segment has a distance and estimated speed. Write a program to

Chapter 4
Route Time
Assume a route between two points has several segments. Each segment has a distance and estimated speed. Write a
program to determine the total time for the route. For this program, prompt the user for the number of segments, and then
use a for statement to loop over each segment, prompting the user for the distance and estimated speed for each segment,
and determining and displaying the total time.
Here is an example session:
Number of legs: 2
Enter leg 1 distance (miles): 30
Enter leg 1 speed (miles/hour): 60
Enter leg 2 distance (miles): 10
Enter leg 2 speed (miles/hour): 30
Total time (minutes): 50
Hint: Time = Distance/Speed
Chapter 5
Tuition
A college charges tuition according to the following:
12 or more credits: $20,000 for semester
1-11 credits: $1,200+$1,700 per credit
Write a program that prompts the user for a number of credits and determines and displays the tuition for the semester.
As part of your program, define and use a function with the signature:
def calcTuition(credits)
which returns the tuition for a given number of credits.
Hint:
if credits 12 :
result =20000
elif credits 1 :
result =1200+1700* credits
return result
 Chapter 4 Route Time Assume a route between two points has

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!