I need help trying to create a loop to calculate asset depreciation within these paramaters.

Part 3) Calculate Depreciation by declining balance.

In a company, fixed assets such as equipment lose their value over time and this charge is called depreciation. Equipment is rarely valued as worthless ie $0, even after a long period of time. Many assets are kept for a set period ie 5 or 10 years and then disposed of. The way to account for this is declining balance depreciation. Each year the value of that asset depreciates by a fixed percentage. The depreciation amount charged will assessed on the depreciated value of this asset

Example: A piece of equipment is purchased for $20,000 and will be depreciated by 20% per year.

First year depreciation charge: $20,000 * 0.20 = $4000. The asset is now valued at $16,000 (20,000-4,000)

Second year depreciation charge: $16,000 * 0.20=$3200. The asset is now valued at $12,800 (16,000-4,000)

Your program will prompt for the starting value of the asset, the depreciation percentage and the number of years this asset will be used. Using a ‘for’ loop, calculate the final depreciated value.

Recommended Answers

All 2 Replies

Your for statement should look something like this:

for (int loopCounter = 0; loopCounter < numberOfYears; loopCounter++)
//code for calculation here

Please show your code performing this computation, and then we can possibly help you. We don't do your homework for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.