Welcome Guest [Log In] [Register]
Team SILO Forum

Forum Quick Links

Forum Rules

Staff Team

Introduce Yourself

Team SILO Wiki

Main Page


Follow Us!

Twitter

Facebook

Stumble Upon

Delicious

Digg

Myspace

Youtube
Video Of The Month


[ Click Here! ] For Full Download and Feedback


Team SILO Lead Staff

[DemonDog]
Founder/Lead Designer/Admin

[Vulcan]
Founder/Global Moderator

[HJKDillon]
Global Moderator

[Reapertura]
Global Moderator

[hawksghetto]
Global Moderator


AV Team

[xXd34thm3t4131fXx]

Welcome to Team SILO. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Playtime Cellular Order Form; ~Completed~
Topic Started: Mar 13 2010, 11:02 AM (981 Views)
DemonDog
Member Avatar
~Speedy Silence~
' Name: Playtime Cellular Project
' Purpose: Calculates the total number of phones ordered and
' the total price of the order.
' Programmer: Jonathan Horton on 2/23/10
' I)emon I)og

Option Explicit On
Option Strict On
Option Infer Off

Public Class frmMain_jwh

'declare module-level variable
Private strSalesPerson As String

Private Sub frmMain_jwh_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'gets the salesperson's name

Const strPrompt As String = "Enter The Salesperson's Name:"
Const strTITLE As String = "Name Entry"

'assign the name to the module-level variable
strSalesPerson = InputBox(strPrompt, strTITLE)

End Sub

Private Sub btnExit_cdh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit_cdh.Click
Me.Close() 'Closes the application
End Sub

Private Sub btnCalc_cdh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc_cdh.Click
'Calculates the total number of phones and displays it to "lblTotalPhones_cdh"
Const decPhone_Price As Decimal = 25D
Const decTax_Rate As Decimal = 0.03D
Dim intBluePhones As Integer
Dim intPinkPhones As Integer
Dim intTotalPhones As Integer
Dim decSubtotal As Decimal
Dim decSalestax As Decimal
Dim decTotalPrice As Decimal

'calculate the total number of phones ordered
Integer.TryParse(txtBlue_cdh.Text, intBluePhones)
Integer.TryParse(txtPink_cdh.Text, intPinkPhones)
intTotalPhones = intBluePhones + intPinkPhones

'calculate the subtotal
decSubtotal = intTotalPhones * decPhone_Price
'calculate the sales tax
decSalestax = decSubtotal * decTax_Rate
'calculate the toal price
decTotalPrice = decSubtotal * decTax_Rate
'display total amounts
lblTotalPhones_cdh.Text = Convert.ToString(intTotalPhones)
lblTotalPrice_cdh.Text = decTotalPrice.ToString("C2")

'display tax and saleperson's name
lblMessage_jwh.Text = strSalesPerson & ":" & " Your sales tax was " _
& decSalestax.ToString("C2") _
& "." & ControlChars.NewLine & strSalesPerson

End Sub

Private Sub btnClear_cdh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear_cdh.Click
'Empties all of the "Text Boxes" and "Total Phones & Total Price"
txtName_cdh.Text = String.Empty
txtAddress_cdh.Text = String.Empty
txtCity_cdh.Text = String.Empty
txtState_cdh.Text = String.Empty
txtZip_cdh.Text = String.Empty
txtBlue_cdh.Text = String.Empty
txtPink_cdh.Text = String.Empty
lblTotalPhones_cdh.Text = String.Empty
lblTotalPrice_cdh.Text = String.Empty
lblMessage_jwh.Text = String.Empty
'It sets the mouse/pointer to the "txtName_cdh" Text Field
txtName_cdh.Focus()
End Sub

Private Sub lblMessage_jwh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblMessage_jwh.Click

End Sub
End Class
Posted Image

Youtube Channel
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · VB.Net Examples · Next Topic »
Add Reply

Share on: Share to Facebook | Share on Bebo | Post to MySpace! | | Post to Delicious! | StumbleUpon

Quote of the Moment


Team SILO Affiliates [ Click to Affiliate ] [ Show All Affiliates ]

Please support us by clicking our vote buttons everyday!
Video Games - Forum Top Sites Forum Topsite Forum Champ VoteForums.com / Forum Topsites, promote your forums, number one forum, best forums, Forum Topsite! Game Sites 50

|Forum Promotion|Add Your Link In|Video Game Forum|

Theme Designed by McKee91
Forum Elements used from Brawl Domain