<p> Purpose of exercise: To understand and implement the control structure - Looping.</p><p>Write a class called Depreciation to compute the depreciation schedules of an asset. Use the two accounting methods: - the straight-line depreciation method, and - the sum-of-digits method of depreciation.</p><p>The algorithm for the straight-line method is simple; the amount to be depreciated is divided evenly over the specified number of years. Suppose that you have an asset of original value of $1,000.00 to be depreciated over 3 years. For example, the following table shows the depreciation and book value of the asset.</p><p>YEAR DEPRECIATION DEPRECIATION ACCUMULATED ASSET RATE AMOUNT DEPRECIATION VALUE 1 1/3 333.33 333.33 666.67 2 1/3 333.33 666.67 333.33 3 1/3 333.33 1000.00 0.00</p><p>The sum-of-the-digits work as follows: Suppose that you have an asset of original value $1,000.00 to be depreciated over 3 years. For example, the following table shows the depreciation and book value of the asset.</p><p>YEAR DEPRECIATION DEPRECIATION ACCUMULATED ASSET RATE AMOUNT DEPRECIATION VALUE 1 3/6 500 .00 500.00 500.00 2 2/6 333.33 833.33 166.67 3 1/6 166.67 1000.00 0.00</p><p>Your program must have the following in order to receive full credits:</p><p>1) showMenu: that displays the following menu when called:</p><p>1 - Straight Line 2 - Sum of Years Digits 0 – Quit 2) displayHeader: displays the table's headers 3) straightLine : displays the straight line method table with appropriate values based on the given asset. 4) sumOfDigits : displays the sum-of-digits method table with appropriate values based on the given asset.</p><p>Write a driver class called TestDepreciation. Use the following data to test the class depreciation.</p><p>Test your program with the following set of data; a) Amount: $10000.0 years: 10 method: straight line b) Amount: $20000.0 years: 10 method: sum of digits</p><p>Note: Use a do .. while loop to control the menu, but while loops to control the methods. </p><p>1</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages1 Page
-
File Size-