Question
Almost all items that we acquire, depreciate over several years. The yearly depreciation in value D for an item is often computed using the formula:
Almost all items that we acquire, depreciate over several years. The yearly depreciation in value D for an item is often computed using the formula:
D = (P S) / Y
where P is the purchase price in $,
Y is the number of years, and
S is the salvage value in $ at the end of Y years.
Write a Java program, named CCCS300_A1_Q2, that that prints a Welcome to the Depreciation calculator! message, prompts user to enter all three values of P, S, and Y as a single input separated by spaces between them (using a Scanner object). The program then computes the yearly depreciation in $, and yearly depreciation in %, and number of years for salvage value to be 10% of purchase price of the item.
Your program must print the results rounded to one decimal digit using the Math.round() function.
Hint: Yearly depreciation % = (yearly depreciation / purchase price) * 100 %.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started