0% found this document useful (0 votes)
27 views7 pages

(402201105) - (Programming 511)

The document is an assignment for Programming 511, submitted by Samukelo Zwane, detailing three programming questions focused on developing Windows applications. The questions involve creating an application for calculating wallpaper rolls, evaluating asset depreciation, and displaying sales data for three regions in South Africa. The assignment includes a table of contents, assessment criteria, and references.

Uploaded by

veem4471
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views7 pages

(402201105) - (Programming 511)

The document is an assignment for Programming 511, submitted by Samukelo Zwane, detailing three programming questions focused on developing Windows applications. The questions involve creating an application for calculating wallpaper rolls, evaluating asset depreciation, and displaying sales data for three regions in South Africa. The assignment includes a table of contents, assessment criteria, and references.

Uploaded by

veem4471
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

FACULTY OF INFORMATION TECHNOLOGY

PROGRAMMING 511
ST
1 SEMESTER ASSIGNMENT

Name & Surname: Samukelo Zwane Student No:402201105


Qualification: Diploma in Information Technology Semester: One
Module Name: Programming 511
Submission Date: 30 June 2022

ASSESSMENT CRITERIA MARK EXAMINER MODERATOR


ALLOCATION MARKS MARKS
MARKS FOR CONTENT
QUESTION ONE 30

QUESTION TWO 30

QUESTION THREE 30

TOTAL MARKS 90

MARKS FOR TECHNICAL ASPECTS

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:

Signature of Examiner: Signature of Moderator:


402201105

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.

QUESTION THREE…………………………………………………………………………………… Page 6 – 7


 Design and implement a Windows application that will display
the total sales made in there three regions in South Africa:
Kwazulu-Natal, Gauteng and Western cape

REFERENCE………………………………………………………………………………………………..Page 7

Page 2 of 7
402201105

QUESTION ONE

Figure 1.1
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

For a = 10 To 35
cmbLenth.Items.Add(a)
cmbWidth.Items.Add(a)
cmdHeight.Items.Add(a)
Next

For a = 40 To 50 Step 0.5


cmbRollCov.Items.Add(a)
Next

End Sub

Private Sub calculateRolls(ByVal intLenth As Integer, ByVal intWidth As Integer,


ByVal intHeight As Integer, ByVal intRollCov As Double)

Dim singleRoll As Integer


Dim roomArea As Integer

roomArea = 2 * (intHeight * intWidth + intHeight * intLenth)


singleRoll = Math.Ceiling(roomArea / intRollCov)

'display Single Roll


txtSingleRoll.Text = singleRoll

End Sub

Page 3 of 7
402201105

Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles


btnCalculate.Click

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

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

For y As Integer = 3 To 20
cmbUsefulLife.Items.Add(y.ToString())
Next
cmbUsefulLife.SelectedIndex = 0

Page 4 of 7
402201105

Private Sub btnDisplaySchedules_Click(sender As Object, e As EventArgs) Handles


btnDisplaySchedules.Click

Dim assetCost As Decimal


Dim salvageValue As Decimal
Dim usefulLife As Integer
If Decimal.TryParse(txtAssetCost.Text, assetCost) = False Then
MsgBox("Enter the asset cost.")
txtAssetCost.Clear()
txtAssetCost.Focus()
Return
End If

If Decimal.TryParse(txtSalvageVal.Text, salvageValue) = False Then


MsgBox("Enter the salvage value.")
txtSalvageVal.Clear()
txtSalvageVal.Focus()
Return
End If

If Integer.TryParse(cmbUsefulLife.SelectedItem.ToString(), usefulLife) = False


Then
MsgBox("Enter the useful life.")
cmbUsefulLife.Focus()
Return
End If
lstDeclining.Items.Clear()
lstYearSum.Items.Clear()
lstDeclining.Items.Add("Year" + vbTab + vbTab + "Depreciation")
lstYearSum.Items.Add("Year" + vbTab + vbTab + "Depreciation")

For y As Integer = 1 To usefulLife


Dim depreciation As Decimal = Financial.DDB(assetCost, salvageValue,
usefulLife, y)
lstDeclining.Items.Add(y.ToString() + vbTab + vbTab +
depreciation.ToString("N"))
depreciation = Financial.SYD(assetCost, salvageValue, usefulLife, y)
lstYearSum.Items.Add(y.ToString() + vbTab + vbTab +
depreciation.ToString("N"))
Next

End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click


Me.Close()
End Sub

End Class
End Sub

Page 5 of 7
402201105

QUESTION THREE

Figure 1.3

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Dim salesAmount(,) As Integer = {{120000, 190000, 175000, 188000, 125000,


163000},
{90000, 85000, 80000, 83000, 87000, 80000},
{65000, 64000, 71000, 67000, 65000, 64000}}

Dim totalSales As Integer = 0


Dim totalSalesKwazuluNatal As Integer = 0
Dim kwazuluNatalPercentages As Integer = 0
Dim totalSalesGauteng As Integer = 0
Dim gautengPercentages As Integer = 0
Dim totalSalesWestern As Integer = 0
Dim westernPercentages As Integer = 0

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

lstRegionsKZN.Items.Add("KwaZulu-Natal Sales (R)")


lstRegionsGauteng.Items.Add("Gauteng Sales (R)")
lstRegionsWC.Items.Add("Western Cape Sales (R)")

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

kwazuluNatalPercentages = (totalSalesKwazuluNatal / totalSales) * 100


gautengPercentages = (totalSalesGauteng / totalSales) * 100
westernPercentages = (totalSalesWestern / totalSales) * 100

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

You might also like