1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
levacccp [35]
3 years ago
7

You want to buy a new car, and you are thinking about two alternatives, car A and car B. You like both cars, and you are conside

ring keeping whichever one you buy for many years to come. As a result, you want to evaluate the total cost of ownership of both cars over many years. Car A costs $20,000, whereas car B costs $30,000. Car A runs 25 miles with a gallon of gas, whereas car B runs 32 miles with a gallon of gas. You estimate that you will drive about 15,000 miles each year, and that gas price is going to be around $2.50 per gallon for the foreseeable future. The maintenance cost of car A is $1,300 in the first year, then that cost increases 15% (with compound growth) each year. The maintenance cost of car B is $1,000 in the first year, then that cost increases 10% (with compound growth) each year. Task 1. Write a method named compareCars(int years) that takes an integer number of years and prints a table with the total ownership cost of each car for each year, starting from year 0 which represents the time of purchase. The method will return the name of the most economical car on the last year. Note: For this problem, you are allowed to break the usual "no print statements inside a method" recommendation. Task 2. Using your method, answer this question: which car would you buy if you plan on keeping it for 5 years? 10 years? Discuss the results. Write your answer in a comment at the top of your code. Task 3. Answer this question: in a method, what is the difference between printing something and returning it? Write your answer in a comment at the top of your code.
Computers and Technology
1 answer:
hjlf3 years ago
4 0

Answer:

Task 1: T = c + (2.5n(A/M))+ m(1+r/100)ⁿ

Task 2: In both 5 & 10 years, Car A is more economical

Task 3: Printing returns the answer in a different dialogue box while return displays the answer in the same window.

Explanation:

Task 1:

C = Cost of car

n = Number of years

m = Maintenance Cost

r = Rate

M = Mileage per gallon

A = Annual mileage

T= Total Cost

T = c + (2.5n(A/M))+ m(1+r/100)ⁿ

Task 2

Car A In 5 years; T = 20000+ (2.5*5(15000/25))+1300(1+0.15)⁵= $30115

Car B In 5 years; T = 30000+ (2.5*5(15000/32))+1000(1+0.10)⁵= $37470

Therefore in 5 years, Car A is more economical.

Car A In 10 years; T = 20000+ (2.5*10(15000/25))+1300(1+0.15)¹⁰= $40259.225

Car B In 10 years; T = 30000+ (2.5*10(15000/32))+1000(1+0.10)¹⁰= $ 44312.49

Therefore in 10 years, Car A is still economical.

Task 3: Printing returns the answer in a different dialogue box while return displays the answer in the same window.

You might be interested in
PLEASE HELP WITH MY COMPUTER
qaws [65]

Answer:

try powering it off the turn it back on

Explanation:

5 0
3 years ago
Read 2 more answers
Does anyone know what anotmy means​
deff fn [24]

Answer:

also its spelled anatomy

Explanation:

The branch of science concerned with the bodily structure of humans, animals, and other living organisms, especially as revealed by dissection and the separation of parts.

Hope this helped :3

3 0
2 years ago
Read 2 more answers
Jamie has to enter the names, grades, and scores of a group of students into a worksheet. Which option will Jamie use to describ
GuDViN [60]

Answer: B. graphs

Jamie can use graphs to describe the data she enter such as names, grades and the scores of the group of students. In addition, using graphs will allow the reader to create visualization of the data, which will help the reader to easily understand and define the main purpose of the data entered.

7 0
3 years ago
Read 2 more answers
What is the simplest unit of a compound that maintains all the characteristics of the compound<br> ?
vlada-n [284]
A molecule is the simplest unit of a compound.
3 0
2 years ago
When are the malls going to open
Amiraneli [1.4K]
Idk maybe at 6:00pm today cuz most of the malls are close. Happy Thanksgiving! :D
3 0
3 years ago
Read 2 more answers
Other questions:
  • Allan needs to ensure that an object is in a very precise location on a slide. He decides to use the Ruler option to achieve thi
    5·2 answers
  • As you move the click and type pointer around the document, the icon changes to represent ____________________ that will be appl
    10·2 answers
  • Targeting encourages drivers to scan far ahead and _____________. A. focus their visual attention on the next point on the road
    8·2 answers
  • Which feature of virtualisation helps increase the IT productivity of a business
    14·1 answer
  • If you have two tasks x and y, with y being a successor to x, if we mark x as undone (because it needs to be redone for some rea
    15·1 answer
  • You can use a minus sign to make a negative numberlike -2. What happens to each of the following 2++2
    8·1 answer
  • During the preventive maintenance phase of a project involving a hydraulic power system, an engineer must change a gasket on a p
    14·1 answer
  • What is a guardian node summary for theta staking tool
    9·1 answer
  • What is one problem caused by spending too much time studying at your computer? A. It increases stress and negatively affects yo
    8·1 answer
  • The economic importance of computer viruses​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!