Question: Instructions: Create a Python program named CST _ 1 5 0 _ Distance _ Traveled.py . Write a function named calculate _ distance that takes

Instructions:
Create a Python program named CST_150_Distance_Traveled.py.
Write a function named calculate_distance that takes speed and time as parameters and returns the calculated distance using the formula: Distance = Speed * Time.
In the main part of your program:
a. Set the speed variable to 70(speed of the car in miles per hour).
b. Set three time variables (time_1, time_2, time_3) to 6,10, and 15 respectively (in hours).
c. Call the calculate_distance function for each time value and store the results in variables.
Display the results using print statements as follows:
a. Print the distance the car will travel in time_1 hours.
b. Print the distance the car will travel in time_2 hours.
c. Print the distance the car will travel in time_3 hours.
Save and run your program to see the calculated distances.
Sample Output:
The distance the car will travel in 6 hours: XXX miles
The distance the car will travel in 10 hours: XXX miles
The distance the car will travel in 15 hours: XXX miles
Note: Replace XXX with the actual distance values.
 Instructions: Create a Python program named CST_150_Distance_Traveled.py. Write a function named

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!