Design a program that will determine how much money you need each month to pay for keeping the car • Your insurance is a constant value and costs $1,600 per year. • Maintenance is determined by the number of miles driven each month at a rate of $0.005 per mile. This means that the miles driven each month should be user input. • Fuel is also determined by the number of miles driven each month. The total cost of fuel is calculated by multiplying the number of miles driven by cost of gasoline divided by your car's fuel efficiency. So. This means that the price of gas and your car's fuel efficiency are also needed as input. The output for your algorithm should be the total cost of using your car PER MONTH

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 20PE: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making...
icon
Related questions
Question
100%

Please explain the steps of the coding attached.

 

Problem #2 - Car Expense
As a college student, you probably are paying close attention to your budget. For this problem, let us assume
that you are working on budgeting and trying to determine the cost of using your car. The cost of using your
car is determined by:
• insurance,
• maintenance, and
• fuel
Design a program that will determine how much money you need each month to pay for keeping the car
• Your insurance is a constant value and costs $1,600 per year.
• Maintenance is determined by the number of miles driven each month at a rate of $0.005 per mile. This
means that the miles driven each month should be user input.
• Fuel is also determined by the number of miles driven each month. The total cost of fuel is calculated by
multiplying the number of miles driven by cost of gasoline divided by your car's fuel efficiency. So.. This
means that the price of gas and your car's fuel efficiency are also needed as input.
• The output for your algorithm should be the total cost of using your car PER MONTH
Some people in your Breakout Room may still be working on Problem #1, so it's okay to "fly solo" and get
started on this part of the lab yourself. As with Problem #1, start by designing and drawing a flowchart for
your algorithm first, before writing any code.
Here's some sample output. Your output will vary based on your input:
RESTART: 7Users/keithbagley/Dropbox/NURTHEASTERN UNIVERSITY,
s/lab1/problem2.py
How many miles per month do you drive? 100
What is the average price of a gallon of gas? 2.50
How many miles per gallon does your car get on average? 20
Your total expense per month is $146.33
If enough of you are a similar point in the development effort, feel free to talk amongst yourselves about
your approach. It's not "cheating" to bounce ideas off of each other as long as you're not copying code.
Transcribed Image Text:Problem #2 - Car Expense As a college student, you probably are paying close attention to your budget. For this problem, let us assume that you are working on budgeting and trying to determine the cost of using your car. The cost of using your car is determined by: • insurance, • maintenance, and • fuel Design a program that will determine how much money you need each month to pay for keeping the car • Your insurance is a constant value and costs $1,600 per year. • Maintenance is determined by the number of miles driven each month at a rate of $0.005 per mile. This means that the miles driven each month should be user input. • Fuel is also determined by the number of miles driven each month. The total cost of fuel is calculated by multiplying the number of miles driven by cost of gasoline divided by your car's fuel efficiency. So.. This means that the price of gas and your car's fuel efficiency are also needed as input. • The output for your algorithm should be the total cost of using your car PER MONTH Some people in your Breakout Room may still be working on Problem #1, so it's okay to "fly solo" and get started on this part of the lab yourself. As with Problem #1, start by designing and drawing a flowchart for your algorithm first, before writing any code. Here's some sample output. Your output will vary based on your input: RESTART: 7Users/keithbagley/Dropbox/NURTHEASTERN UNIVERSITY, s/lab1/problem2.py How many miles per month do you drive? 100 What is the average price of a gallon of gas? 2.50 How many miles per gallon does your car get on average? 20 Your total expense per month is $146.33 If enough of you are a similar point in the development effort, feel free to talk amongst yourselves about your approach. It's not "cheating" to bounce ideas off of each other as long as you're not copying code.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Transmission media
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr