0% found this document useful (0 votes)
35 views

CIS 125 - Project 3 (Chapter 5 Programming Project #3) Total 50 PTS

The document provides instructions for Project 3 which involves documenting code sections that calculate furniture order costs and generate an invoice in a spreadsheet, explaining the code in a word document, and implementing the code. The code calculates item costs, total cost, generates an invoice number and formats customer names, clears fields, and closes the form. Students are instructed to complete the documentation and coding tasks for 6 sections of Visual Basic code.

Uploaded by

Jeff Tyler
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

CIS 125 - Project 3 (Chapter 5 Programming Project #3) Total 50 PTS

The document provides instructions for Project 3 which involves documenting code sections that calculate furniture order costs and generate an invoice in a spreadsheet, explaining the code in a word document, and implementing the code. The code calculates item costs, total cost, generates an invoice number and formats customer names, clears fields, and closes the form. Students are instructed to complete the documentation and coding tasks for 6 sections of Visual Basic code.

Uploaded by

Jeff Tyler
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CIS 125 Project 3 (Chapter 5 programming project #3) Total 50 PTS

Submit your word document, spreadsheet, code printout, and have me initial this spot
_____worked, _____ didnt work when you are done.

You should have the Form Object Documentation spread sheet ready to go. 10pts
For each section of code below:
1. explain what the code is doing in a word document. (15pts)
2. insert the code as a comment in your Form Object Documentation spreadsheet (10pts)
3. insert the code into your code editor attached to the correct object (15pts)
Code Section A.
Const COST_PER_CHAIR As Double = 350
Const COST_PER_SOFA As Double = 925
Const SALES_TAX_RATE As Double = 0.05
Code Section B.
Private Sub bntProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles bntProcess.Click
Dim cost As Double
Dim totalCost As Double
cost = COST_PER_CHAIR * CDbl(txtChairs.Text) + COST_PER_SOFA * CDbl(txtSofas.Text)
totalCost = cost + SALES_TAX_RATE * cost
lstInvoice.Items.Clear()
lstInvoice.Items.Add("Invoice Number: " & InvoiceNumber())
lstInvoice.Items.Add("")
lstInvoice.Items.Add("Name: " & NameInProperOrder())
lstInvoice.Items.Add("Address: " & txtAddress.Text)
lstInvoice.Items.Add("City: " & txtCityState.Text)
lstInvoice.Items.Add("")
lstInvoice.Items.Add("Number of Chairs: " & txtChairs.Text)
lstInvoice.Items.Add("Number of Sofas: " & txtSofas.Text)
lstInvoice.Items.Add("")
lstInvoice.Items.Add("
Cost:" & " " & FormatCurrency(cost))
lstInvoice.Items.Add("Sales Tax:" & " " & FormatCurrency(SALES_TAX_RATE * cost))
lstInvoice.Items.Add("
------------")
lstInvoice.Items.Add("Total Cost:" & " " & FormatCurrency(totalCost))
End Sub
Code Section C.
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnClear.Click
txtName.Text = ""
txtAddress.Text = ""
txtCityState.Text = ""
txtChairs.Text = ""
txtSofas.Text = ""
txtName.Focus()
lstInvoice.Items.Clear()
End Sub
Code Section D.
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnQuit.Click
Me.Close()
End Sub

Code Section E.
Private Function InvoiceNumber() As String
Dim endOfZip, str As String
endOfZip = txtCityState.Text.Substring(txtCityState.Text.Length - 4)
str = txtName.Text.Substring(0, 2).ToUpper & endOfZip
Return str
End Function
Code Section F.
Private Function NameInProperOrder() As String
Dim name, firstName, lastName As String
Dim comma As Integer
name = txtName.Text
comma = name.IndexOf(",")
lastName = name.Substring(0, comma)
firstName = name.Substring(comma + 2)
Return firstName & " " & lastName
End Function
End Class

You might also like