Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions