Programming Assignment 4 Instructions
Adapted from Introduction to Programming Using Visual Basic 2012, 9/E, David I. Schneider.
A furniture manufacturer makes two types of furniture – chairs and sofas. The cost per chair is $350, the cost per sofa is $925, and the sales tax rate is 5%. Write a Visual Basic program to create an invoice form for an order. (See the diagram below.) After the data on the left side of the form are entered, the user can display an invoice in a list box by pressing the Process Order button. The user can click on the Clear Order Form button to clear all text boxes and the list box, and can click on the Quit button to exit the program. The invoice number consists of the capitalized first two letters of the customer’s last name, followed by the last four digits of the zip code. The customer name is input with the last name first, followed by a comma, a space, and the first name. However, the name is displayed in the invoice in the proper order. The generation of the invoice number and the reordering of the first and last names should be carried out by Function procedures.
Programming Assignment 5 Instructions
Adapted from Introduction to Programming Using Visual Basic 2012, 9/E, David I. Schneider.
Depreciation to a Salvage Value of 0:
Instructions:
Depreciation is the systematic and rational allocation of cost over a period of time.
For tax purposes, an item may be depreciated over a period of several years, n. With the straight-line method of depreciation, each year the item depreciates by 1/nth of its original value. With the double-declining-balance method of depreciation, each year the item depreciates by 2/nths of its value at the beginning of that year. (In the final year, it is depreciated by its value at the beginning of the year.) Write a Visual Basic program that performs the following tasks:
Deliverables:
a. Request a description of the item, the year of the purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. The method of depreciation should be chosen by clicking on one of two buttons.
b. Using the formulas below, calculate the amount of depreciation per year given the values entered by the user. You may assume a salvage value of $0.00 and a January 1 date of purchase for the year entered. Display a year-by-year description of the depreciation. See the diagram below.
Straight-line formula:
Cost – Salvage Value = Depreciation amount per year
Estimated life in years
Using the entries in the diagram below:
1000 – 0 = $250 per year to be depreciated
4
Double-declining formula:
Double the straight-line rate and multiple the result times the remaining balance for every year until the last year of useful life.
For example, assume that using illustration of the straight-line method above results in 25% depreciation per year.
1 / 4 years = 25%
The double-declining balance method results in 50% depreciation per year (twice the straight-line rate).
Thus,
Depreciation Year #1:
Initial cost year #1 = $1,000
Amount of depreciation = $500 (which is 50% x $1,000)
The balance to be depreciated over the next 3 years is $500 ($1,000 initial cost - $500 depreciation in year 1)
Depreciation Year #2:
Remaining cost to depreciate $500
Amount of depreciation = $250 (which is 50% x $500)
The balance to be depreciated over the next 2 years is $250 ($500 – 250)
Depreciation Year #3:
Remaining cost to depreciate $250
Amount of depreciation = $125 (which is 50% x $250)
The balance to be depreciated over the next 2 years is $125 ($250 – 125)
Depreciation Year #4:
Remaining cost to depreciate $125
Since this is the last year of depreciation, the remaining $125 is depreciated.
c. Note that in your output, you must indicate the remaining balance of the item at the beginning of the year, followed by the amount of depreciation to be taken during the year, and finally followed by the total amount of accumulated depreciation on the asset since its purchase.
d. Make sure you use good software design principles, such as clearing the listbox after a user clicks a button but before new results are displayed.