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
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 %. Sample output screen: Welcome to the Depreciation calculator! Enter values (Purchase price, Salvage value, and Years): 300 25 5 Yearly depreciation = $55.0 Yearly depreciation = 18.3% Number of years for salvage value to be 10% of purchase price = 4.9 years
Step by Step Solution
There are 3 Steps involved in it
Heres an example of how you could write the Java program to achieve this java import javautilScanner ... View full answer
Get step-by-step solutions from verified subject matter experts
