Accounting | Business | Computer
Science | General
Studies | Math | Sciences | Civics Exam | Help/Support | Join/Cancel | Contact Us | Login/Log Out
Exam 1 2 3 4 5 6 7 8 9 10 Midterm 1 2 Final Exam 1 2 Graded Program Assignment 1 2 3 4 5 6 7 8 9 Python Compiler Computer Programming Assignment 7 Miles Per Gallon Functions # PROGRAMMER: # PROGRAM NAME: Assignment #07 - Calculate Miles per Gallon using Functions # DATE WRITTEN: # PURPOSE: Use assignment statements to calculate the Miles Per Gallon # Functions will be used to re-organize this program #================================================================================== # INITIALIZE / DECLARE PROCESSED VARIABLES def main(): Join Now For Answers & Help!!! #================================================================================== # INPUT STATEMENTS milesDriven Join Now For Answers & Help!!! #================================================================================== #Calculations / processing # Call function to calculate the miles per gallon milesPerGallon = calculateMilesPerGallon(milesDriven, gallonsUsed); #================================================================================== print( Join Now For Answers & Help!!!); print( Join Now For Answers & Help!!!); print("MILES PER GALLON INFORMATION"); print( Join Now For Answers & Help!!!); print( Join Now For Answers & Help!!!)); print( Join Now For Answers & Help!!!); print( Join Now For Answers & Help!!!)); print( Join Now For Answers & Help!!!); print( Join Now For Answers & Help!!!)); print( Join Now For Answers & Help!!!); #================================================================================== # Function to calculate miles per gallon def calculateMilesPerGallon(miles, gallons): result = miles / gallons; return result; # end calculateMilesPerGallon function #================================================================================== # Call the Main Function main(); #================================================================================== # END PROGRAM # PROGRAMMER: # PROGRAM NAME: Total Purchases.py # DATE WRITTEN: # PURPOSE: To calculate total purchases and organize as functions # This program sums the five prices, calculates sales tax, and sums total sales. #========================================================================================================= # MAIN PROGRAM Join Now For Answers & Help!!! Join Now For Answers & Help!!! #===================================================================================================== # Input statements Join Now For Answers & Help!!! #===================================================================================================== #Calculations / processing # Call calculateTotalPrices to sum the total price Join Now For Answers & Help!!! # Call the calculateSalesTax function to calculate sales tax Join Now For Answers & Help!!! # Call the calculateSalesAmount function Join Now For Answers & Help!!! #===================================================================================================== # Output Statements # displayPriceData: displays all prices print(); Join Now For Answers & Help!!! # displayTotalResults: displays sum of prices, sales tax and displays total sales amount. Join Now For Answers & Help!!! #===================================================================================================== #========================================================================================================= # Function: to sum the total prices Join Now For Answers & Help!!! #========================================================================================================= # Function: to calculate sales tax Join Now For Answers & Help!!! #========================================================================================================= # Function: to sum total sales Join Now For Answers & Help!!!n #========================================================================================================= Join Now For Answers & Help!!!); #========================================================================================================= # END PROGRAM Exam
1 2 3 4 5 6 7 8 9 10 Midterm 1
2 Final Exam 1
2
Graded Program Assignment 1 2 3 4 5 6 7 8 9 Python Compiler |
Home |
Accounting & Finance | Business |
Computer Science | General Studies | Math | Sciences |
Civics Exam |
Everything
Else |
Help & Support |
Join/Cancel |
Contact Us |
Login / Log Out |