CSCI 2000B

Spring 1999

Assignment 5

Date: 2/9/99 Due: 2/16/99 20 points

Write, enter, run, debug, and get working a QBASIC program to solve the following problem:

For tax purposes, you want to do the calculations to depreciate equipment over several years. You are going to look at two basic methods of depreciation; the straight-line method and the double-declining method. To depreciate an item over n years, the straight-line method has you reduce the value by 1/n of its original value each year. With the double-declining method, the value declines by a factor of 2/n from its value at the beginning of that year, but in the last year it declines to a value of zero. (The IRS actually uses more complicated versions of these methods.)

The program should ask for a description of the item, cost of the item, the number of years to be depreciated, and the method of depreciation (you can have the user choose between entering "s" and "d" to indicate the method). The program will then print the date (DATE$), the information entered, and the depreciation amounts for each year. It should then ask the user if they want to do another item and continue until they want to quit.

Possible screen:


Description of item: New computer

Cost: 3000

Estimated life in years: 5

Method of depreciation(s = straight-line, d= double-declining): d

02-09-1999

Value at Amount Total amount

Year Beg of Yr Depreciated Depreciated

1 3000 1200 1200

2 1800 720 1920

3 1080 432 2352

4 648 259.2 2608.2

5 391.8 391.8 3000

Do you want to do another item (y/n)?y

...


Turn in a listing of your program and a 3.5 inch disk containing the program. Write your name on the disk and the file name of the program. All assignments are due at the beginning of class with late assignments reduced by 10% per day, up to a maximum reduction of 50%.