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
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:
Enter leg distance miles:
Enter leg speed mileshour:
Enter leg distance miles:
Enter leg speed mileshour:
Total time minutes:
Hint: Time DistanceSpeed
Chapter
Tuition
A college charges tuition according to the following:
or more credits: $ for semester
credits: $$ 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 calcTuitioncredits
which returns the tuition for a given number of credits.
Hint:
if credits :
result
elif credits :
result credits
return result
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
