Question

Design a modular program that asks the user to enter the monthly costs for the following...

Design a modular 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, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, the total trimester amount, the total semester amount and the total annual cost of these expenses.

Submission should have:

  • Source Code in PY format (No accepted screenshots of source code anymore)
    • It should contain proper indentation
    • Comments (Blocks or Lines)
    • Good Variables initializations
    • Good questions asking for the parameters of the code
    • Output display with explanation
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any queries write a comment if understood upvote Thank you.

SOLUTION:

#read all the expenses
loanPayment=float(input("Enter Monthly loan Amount "))
insuranceAmount=float(input("Enter Monthly Insurance Amount "))
gasAmount=float(input("Enter Monthly Gas Amount "))
oilAmount=float(input("Enter Monthly Oil Amount "))
tiresAmount=float(input("Enter Monthly tires Amount "))
# add the all the expenses to get the total expenses of one month
totalExpenditures=loanPayment+insuranceAmount+gasAmount+oilAmount+tiresAmount
# print expenses for one month
print("Monthly expenses ",totalExpenditures)
#print expenses for 3 months by multiplying monthly expenses by 3
print("Expenses for trimester ",totalExpenditures*3)
#print expenses for 6 months by multiplying monthly expenses by 6
print("Expenses for Semester ",totalExpenditures*6)
#print expenses for 12 months by multiplying monthly expenses by 12
print("Annual Expenses ",totalExpenditures*12)

CODE IMAGE:

X te expenses.py - C:/Users/vinod/AppData/Local/Programs/Python/Python37-32/expenses.py (3... - O File Edit Format Run Option

OUTPUT:

RESTART: C:/Users/vinod/AppData/Local/Progra Enter loan Amount 1000 Enter Insurance Amount 2000 Enter Gas Amount 1500 Enter O

Add a comment
Know the answer?
Add Answer to:
Design a modular program that asks the user to enter the monthly costs for the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In python coding please add functions/methods at least 3 of them. Please just adjust code I...

    In python coding please add functions/methods at least 3 of them. Please just adjust code I have provided and update it to include functions/methods. You can rearrange the code, edit or delete parts to add functions/methods. PLEASE DO NOT make a Whole New code. Please use what I have provided. I do not need a whole different code, just edits on what I have provided. THIS is the original question:Design a modular program that asks the user to enter the...

  • Project 1, Program Design 1. Write a C program replace.c that asks the user to enter...

    Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....

  • In python coding please with proper indentation, comments, good variable initializations, questions asking for the parameters...

    In python coding please with proper indentation, comments, good variable initializations, questions asking for the parameters of the code and output display with explanation.: Assume that hot dogs come in packages of 20, and hot dog buns come in packages of 8. Design a modular program that calculates the number of packages of hot dogs and the number of packages of hot dog buns needed for a cookout, with the minimum amount of leftovers. The program should ask the user...

  • Design a program that asks the user to enter a series of 20 numbers. The program...

    Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in the array and then display the following data: The lowest number in the array The highest number in the array The total of the number in the array The average of the numbers in the array PLEASE GIVE THE PSEUDOCODE AND CODE IN C PROGRAMMING

  • PLEASE WRITE IN 80X86 ASSEMBLY LANGUAGE Write a program that asks the user to enter their...

    PLEASE WRITE IN 80X86 ASSEMBLY LANGUAGE Write a program that asks the user to enter their monthly costs for each of the following housing-related expenses: rent or mortgage payment utilities phones cable The program should then display the total monthly cost of these expenses and the total annual cost of these expenses.

  • Design a program that asks the user to enter a store's sales for each day of...

    Design a program that asks the user to enter a store's sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. Be sure to attach your PYTHON code. No modularization required.

  • Create a program that asks that asks the user for the number of males and females...

    Create a program that asks that asks the user for the number of males and females in a class. The program should display a percentage of males and females. For example, there are 5 males, and 15 females. That makes 20 people total. To find the percentage of males you can divide 5 by 20, which makes 0.25, or 25% HINT: USE A VARIABLE for every group of people that you will use in your calculation. Submit your .java source...

  • Total Sales Design a program that asks the user to enter a store’s sales for each...

    Total Sales Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. Need: variable lists, IPO Chart, pseudocode, Flowchart, and working Python code. 2. Lottery Number Generator Design a program that generates a 7-digit lottery number. The program should have an Integer array with 7 elements. Write a loop...

  • Design a program that lets the user enter the total rainfall for each of 12 months...

    Design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amount. PLEASE MODULARIZED THE CODE   PLEASE USE C PROGRAMMING AND ADD PSEUDOCODE

  • Design a program using Flowgorithm or any flowcharting software that asks the user to enter a...

    Design a program using Flowgorithm or any flowcharting software that asks the user to enter a store's sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. PSEUDOCODE AND FLOWCHART IS REQUIRED FOR THIS CLASSWORK.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT