Question: Example: Program 6-11 save_running_times.py & 6-12 read_running_times.py & 7-12 drop_lowest_score.py Function Start Function Function avg_cars() write_cars() read_cars() receive argument cars_tuple First, declare global variable called

 Example: Program 6-11 save_running_times.py & 6-12 read_running_times.py & 7-12 drop_lowest_score.py Function

Example: Program 6-11 save_running_times.py & 6-12 read_running_times.py & 7-12 drop_lowest_score.py Function Start Function Function avg_cars() write_cars() read_cars() receive argument cars_tuple First, declare global variable called filename. Get the number of Second, assign cars on the lot. Open the filename in reading filename = the output Put value in whole mode. Assign this opening Assign to avg_tuple the text file cars number data type to cars_file. function's received variable called argument. cars_qty main() Create empty list called cars list Initialize the running total Calls named sum_total to a function Open an empty file by decimal value of zero main referencing filename for inputting new data. Assign this opening to Use for loop get the Initialize the variable named cars_file. values from the file into a cars_count to keep count of variable assigned to the whole number cars. Print ("Program Decimal Data Type Completed finished.") cost_value reading Use cars_file Use for loop for loop having counter Not completed reading cars_file read tuple element value End called item_num in into a Decimal Data Type range of Append value of cost_value stripping off '\ ' to the list variable called cars_qty Completed reading cost_value cars_list Completed cars_file reading cars_file Not completed reading cars_file function Not completed reading tuple main input("Car#' Close the file concatenated with Keep a running total by item num + 1 adding sum_total with concatenated with " Convert list to tuple named cost_value Enter car cost: ") cars_tuple Call function concatenate '\ ' write_cars() assign to string Data Increment the Type Print ("The cost value cost_value of each car has been cars_count variable saved to a tuple called cars_tuple" Call Write the string function line cost_value to Use one print statement without Calculate avg_car_cost read_cars() cars_file. looping display all of cars_tuple = sum_total divided by cars_count Close the file Return cars_tuple Print ("This is the total cost Call function value for all cars $' avg_cars() concatenated with formated pass cars_tuple Print ("The cost value of sum_total to two deci each car has been saved on places) a newline to file: ", filename) Print ("For the " concatenated with cars_count exit Return concatenated with " cars this is the average cost cars_qty value for a car $" concatenated with formated avg_car_cost to two decimal places) exit

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 Programming Questions!