Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Practice 5.2: Automobile costs 20 pts Not Submitted Due Feb 23, 2020 at 11:59 PM Submission Types Website URL Submission & Rubric Description Lesson

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Programming Practice 5.2: Automobile costs 20 pts Not Submitted Due Feb 23, 2020 at 11:59 PM Submission Types Website URL Submission & Rubric Description Lesson Objective(s): Break a program into functions (modular programming) Pass a parameter from one function to another Lesson: Write a program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: loan payment, insurance, gas, and maintenance. The program should then display the total monthly cost of these expenses, and the total annual cost of these expenses. Assign meaningful names to your functions and variables. Every function also needs a comment explaining what it does and what other function it works with Program Outline: main(): calls the other functions main is traditionally used as the first function in a program to organize the flow of the program logic monthly(): 1. Gather information from the user 2. Accumulate the total in a local variable 3. Print the monthly costs on screen, formatted appropriately for money 4. Pass the monthly cost to Function 2 yearly(monthly_total): 1. Accepts a float parameter 2. Calculates yearly cost by multiplying the monthly cost by 12 3. Displays the yearly cost on screen, formatted appropriately for money Assignment Requirements: Upload your .py file to Git Hub and submit the link to that file. Follow the program outline. Sample Results: How much do you pay for your car loan e How much do you pay for your car insura How much do you spend on gas each month What is the average amount you spend on You spend $652.00 on your car each mont You spend $7,824.00 per year on your ca E your car loan each month? 423.00 = your car insurance each month? 89 on gas each month? 80 punt you spend on maintenance monthly? 60 our car each month. = year on your car

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions