melloman
02-01-2013, 12:50 PM
This is a call for anyone who has done Intro to Visual Basic.
You can see the full assignment in the spoiler:
http://i.imgur.com/p769OI0.jpghttp://i.imgur.com/tAWoWDS.jpg
Coding:
'-
Option Strict On
Public Class Form1
Private Sub btnDefault_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDefault.Click
Dim intCustNumber As Integer
Dim intAdult As Integer
Dim intKid As Integer
'to change dtpSail date 7 days from system date
dtpSail.Value = DateAdd(DateInterval.Day, 7, Today)
txtCustName.Text = "********"
txtCustNumber.Text = "*********"
txtAdult.Text = "2"
txtKid.Text = "1"
rbRV.Checked = True
'Setting RV as automatic Default
rbVanVic.Checked = True
'Setting Van-Victoria as automatic Default
cbWiFi.Checked = True
'Setting WiFi as automatic Default
End Sub
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
Dim bytAdult, bytKids As Byte
Dim intAmount As Integer
Dim intAdultamt, intKidsamt As Double
Dim intWifi As Integer
Dim intRestaurant, intNonRv, intRV, intFootPass, intVanVic, intVanNan As Double
Dim strName() As String
Dim strFormat As String = "{0,-20}{1,30:c2}"
':c2 is currency format with 2 dec
Dim intResult As Integer
'Dim strCustName As String
Dim dblAmount As Double
Dim dblRestaurant As Double
Dim dblWifi As Double
'Dim txtAdult As String
Dim dblFootPass As Double
bytAdult = CByte(txtAdult.Text)
bytKids = CByte(txtKid.Text)
intAdultamt = bytAdult * 15
intKidsamt = bytKids * 12.5
'intAdultamt = 15
'intKidsamt = 12.5
intFootPass = 0
intRV = 50
intNonRv = 35.75
intVanVic = 12.5
intVanNan = 22.5
dblRestaurant = 15
If cbWiFi.Checked = True Then
dblWifi = dblWifi + 5
Else
dblWifi = dblWifi + 0
End If
cbWiFi.Checked = CBool(FormatCurrency(dblWifi, 2))
dtpSail.Value = DateAdd(DateInterval.Day, 7, Today)
txtCustName.Text = "*********"
'txtCustNumber.Text = "**********"
lstResult.Items.Add(String.Format(strFormat, "Invoice ID", txtCustNumber.Text))
lstResult.Items.Add(String.Format(strFormat, "Customer Name", txtCustName.Text))
lstResult.Items.Add(String.Format(strFormat, "Reservation Date", dtpSail.Value))
'lstResult.Items.Add(String.Format(strFormat, "Reservatopm Date",
'lstResult.Items.Add(String.Format(strFormat, "Sail Date",
lstResult.Items.Add(String.Format(strFormat, "Passenger Fare", intAdultamt + intKidsamt))
Select Case True
Case rbFootPass.Checked
lstResult.Items.Add(String.Format(strFormat, "Category Charge", intFootPass))
Case rbRV.Checked
lstResult.Items.Add(String.Format(strFormat, "Category Charge", intRV))
Case rbNonRV.Checked
lstResult.Items.Add(String.Format(strFormat, "Category Charge", intNonRv))
End Select
Select Case True
Case rbVanVic.Checked
lstResult.Items.Add(String.Format(strFormat, "Destination Charge", intVanVic))
Case rbVanNan.Checked
lstResult.Items.Add(String.Format(strFormat, "Destination Charge", intVanNan))
End Select
'lstResult.Items.Add(String.Format(strFormat, "Restaurant Charge", intAdultamt))
lstResult.Items.Add(String.Format(strFormat, "Wifi Charge", dblWifi))
'lstResult.Items.Add(String.Format(strFormat, "Total Amount Due",
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
End
End Sub
End Class
Issues:
'Invoice ID: to display last 3 digits of customer number and Initals of Name. Eg. EL725
'Customer Name "Last Name, First Name" while Customer Name txt box remains "First Name Last Name"
'Reservation Date = system date but in mm/dd/yyyy
'Sail Date = show sail date 7 days from reservation date
'Restaurant Charge = how to have seperate charges for adults and kids
'Total Amount Due = add everything together.
ANY HELP IS GREATLY APPRECIATED AS THIS IS DUE TOMORROW AT MIDNIGHT..
P.S. If you can help me figure this shit out. Coffee and donuts are on me at a n00b/RS meet.
You can see the full assignment in the spoiler:
http://i.imgur.com/p769OI0.jpghttp://i.imgur.com/tAWoWDS.jpg
Coding:
'-
Option Strict On
Public Class Form1
Private Sub btnDefault_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDefault.Click
Dim intCustNumber As Integer
Dim intAdult As Integer
Dim intKid As Integer
'to change dtpSail date 7 days from system date
dtpSail.Value = DateAdd(DateInterval.Day, 7, Today)
txtCustName.Text = "********"
txtCustNumber.Text = "*********"
txtAdult.Text = "2"
txtKid.Text = "1"
rbRV.Checked = True
'Setting RV as automatic Default
rbVanVic.Checked = True
'Setting Van-Victoria as automatic Default
cbWiFi.Checked = True
'Setting WiFi as automatic Default
End Sub
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
Dim bytAdult, bytKids As Byte
Dim intAmount As Integer
Dim intAdultamt, intKidsamt As Double
Dim intWifi As Integer
Dim intRestaurant, intNonRv, intRV, intFootPass, intVanVic, intVanNan As Double
Dim strName() As String
Dim strFormat As String = "{0,-20}{1,30:c2}"
':c2 is currency format with 2 dec
Dim intResult As Integer
'Dim strCustName As String
Dim dblAmount As Double
Dim dblRestaurant As Double
Dim dblWifi As Double
'Dim txtAdult As String
Dim dblFootPass As Double
bytAdult = CByte(txtAdult.Text)
bytKids = CByte(txtKid.Text)
intAdultamt = bytAdult * 15
intKidsamt = bytKids * 12.5
'intAdultamt = 15
'intKidsamt = 12.5
intFootPass = 0
intRV = 50
intNonRv = 35.75
intVanVic = 12.5
intVanNan = 22.5
dblRestaurant = 15
If cbWiFi.Checked = True Then
dblWifi = dblWifi + 5
Else
dblWifi = dblWifi + 0
End If
cbWiFi.Checked = CBool(FormatCurrency(dblWifi, 2))
dtpSail.Value = DateAdd(DateInterval.Day, 7, Today)
txtCustName.Text = "*********"
'txtCustNumber.Text = "**********"
lstResult.Items.Add(String.Format(strFormat, "Invoice ID", txtCustNumber.Text))
lstResult.Items.Add(String.Format(strFormat, "Customer Name", txtCustName.Text))
lstResult.Items.Add(String.Format(strFormat, "Reservation Date", dtpSail.Value))
'lstResult.Items.Add(String.Format(strFormat, "Reservatopm Date",
'lstResult.Items.Add(String.Format(strFormat, "Sail Date",
lstResult.Items.Add(String.Format(strFormat, "Passenger Fare", intAdultamt + intKidsamt))
Select Case True
Case rbFootPass.Checked
lstResult.Items.Add(String.Format(strFormat, "Category Charge", intFootPass))
Case rbRV.Checked
lstResult.Items.Add(String.Format(strFormat, "Category Charge", intRV))
Case rbNonRV.Checked
lstResult.Items.Add(String.Format(strFormat, "Category Charge", intNonRv))
End Select
Select Case True
Case rbVanVic.Checked
lstResult.Items.Add(String.Format(strFormat, "Destination Charge", intVanVic))
Case rbVanNan.Checked
lstResult.Items.Add(String.Format(strFormat, "Destination Charge", intVanNan))
End Select
'lstResult.Items.Add(String.Format(strFormat, "Restaurant Charge", intAdultamt))
lstResult.Items.Add(String.Format(strFormat, "Wifi Charge", dblWifi))
'lstResult.Items.Add(String.Format(strFormat, "Total Amount Due",
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
End
End Sub
End Class
Issues:
'Invoice ID: to display last 3 digits of customer number and Initals of Name. Eg. EL725
'Customer Name "Last Name, First Name" while Customer Name txt box remains "First Name Last Name"
'Reservation Date = system date but in mm/dd/yyyy
'Sail Date = show sail date 7 days from reservation date
'Restaurant Charge = how to have seperate charges for adults and kids
'Total Amount Due = add everything together.
ANY HELP IS GREATLY APPRECIATED AS THIS IS DUE TOMORROW AT MIDNIGHT..
P.S. If you can help me figure this shit out. Coffee and donuts are on me at a n00b/RS meet.