(402201105) - (Programming 511)
(402201105) - (Programming 511)
PROGRAMMING 511
ST
1 SEMESTER ASSIGNMENT
QUESTION TWO 30
QUESTION THREE 30
TOTAL MARKS 90
1. TABLE OF CONTENTS
2
2. LAYOUT AND SPELLING
3
3. REFERENCE 5
TOTAL MARKS 10
TOTAL MARKS FOR ASSIGNMENT 100
Examiner’s Comments:
Moderator’s Comments:
TABLE OF CONTENTS
QUESTION ONE………………………………………………………………………………………page 3 – 4
Design a Windows application named Wallpaper App to
calculate the number of single rolls of wallpaper required
to cover a room.
QUESTION TWO………………………………………………………………………………………Page 4 – 5
Develop an application that will evaluate the company’s
asset’s annual depreciation using the double-declining balance
and sum-of-the years’ digit method.
REFERENCE………………………………………………………………………………………………..Page 7
Page 2 of 7
402201105
QUESTION ONE
Figure 1.1
Public Class Form1
For a = 10 To 35
cmbLenth.Items.Add(a)
cmbWidth.Items.Add(a)
cmdHeight.Items.Add(a)
Next
End Sub
End Sub
Page 3 of 7
402201105
calculateRolls(Integer.Parse(cmbLenth.SelectedItem),
Integer.Parse(cmbWidth.SelectedItem),
Integer.Parse(cmdHeight.SelectedItem),
Double.Parse(cmbRollCov.SelectedItem))
End Sub
End Class
QUESTION TWO
Figure 1.2
For y As Integer = 3 To 20
cmbUsefulLife.Items.Add(y.ToString())
Next
cmbUsefulLife.SelectedIndex = 0
Page 4 of 7
402201105
End Sub
End Class
End Sub
Page 5 of 7
402201105
QUESTION THREE
Figure 1.3
For i As Integer = 0 To 2
For j As Integer = 0 To 5
totalSales += salesAmount(i, j)
Next
Next
Page 6 of 7
402201105
For j As Integer = 0 To 5
totalSalesKwazuluNatal += salesAmount(0, j)
totalSalesGauteng += salesAmount(1, j)
totalSalesWestern += salesAmount(2, j)
lstRegionsKZN.Items.Add(salesAmount(0, j).ToString())
lstRegionsGauteng.Items.Add(salesAmount(1, j).ToString())
lstRegionsWC.Items.Add(salesAmount(2, j).ToString())
Next
txtTotalSA.Text = Math.Ceiling(totalSales).ToString()
txtTotalKZN.Text = Math.Ceiling(totalSalesKwazuluNatal).ToString()
txtKZNPerc.Text = Math.Ceiling(kwazuluNatalPercentages).ToString() + "%"
txtTotalGauteng.Text = Math.Ceiling(totalSalesGauteng).ToString()
txtGautengPerc.Text = Math.Ceiling(gautengPercentages).ToString() + "%"
txtTotalWestern.Text = Math.Ceiling(totalSalesWestern).ToString()
txtWesternPerc.Text = Math.Ceiling(westernPercentages).ToString() + "%"
End Sub
End Class
Bibliography
Hassan, A. B., Abolarin, M. S. & Onawola, H. J., 2006. The application of Visual Basic computer
programming language to simulate numerical iterations. s.l.:s.n.
Sells, C. & Gehtlad, J., 2004. Windows forms programming in Visual Basic. NET. Addison-Wesley
Professional.. s.l.:s.n.
Page 7 of 7