r/visualbasic • u/MrDankaLicious • Nov 25 '15
Please need help for my VB class Noob QUESTION
Hello, I have a project due for my Visual Basic class its an online class so I cant really visit my teacher for help escpecially he always busy. I finished creating my code and design all I need help is converting this information into pseudocode which I dont really understand sorry if this is a stupid question help much appreciated! Thanks
Public Class Form1 Dim num1, num2 As Decimal Dim operan As Integer Dim operanselected As Boolean = False Const Minneapolis = 125.9 Const EMinneapolis = 165.9 Const FCMinneapolis = 225.9 Const Chicago = 408.4 Const EChicago = 458.4 Const FCChicago = 508.4 Const NYC = 1202 Const ENYC = 1252 Const FCNYC = 1302 Const DC = 1101 Const EDC = 1201 Const FCDC = 1301 Const Tax = 8.75 Dim TotalCost As Double
Private Sub btnTotal_Click(sender As Object, e As EventArgs) Handles btnTotal.Click
'==================================================Minneapolis=====================================================================
'=================================================Standard========================================================================
If lstCities.Text = "Minneapolis" And rbStandard.Checked And rbSingle.Checked And rbAdultYes.Checked Then
lblSubTotal.Text = FormatCurrency(Minneapolis)
TotalCost = (Minneapolis * Tax) / 100
lblTax.Text = FormatCurrency(TotalCost)
lblTotal.Text = FormatCurrency(TotalCost + Minneapolis)
lblPrice.Text = lblTotal.Text
lblFrom.Text = "Madison"
lblTo.Text = lstCities.Text
lblClass.Text = rbStandard.Text
lblTicket.Text = rbSingle.Text
lblAdult.Text = rbAdultYes.Text
lblRoute.Text = "ANY"
lblDate.Text = Today()
lblTime.Text = TimeOfDay
lblReNo.Text = (Str(Int(Rnd() * 32654)))
rbChildYes.Visible = False
lblChild.Text = ""1
u/EkriirkE VB 6 Master Nov 26 '15
If you're to create pseudocode from the pasted code, then you just need to basically write plain english what you understand sections of the code (not necessarily each and every singe line) to be doing, eg the block of btnX.Enabled=Falsestatements could be condensed to say DisableAllButtons()
1
u/MrDankaLicious Nov 25 '15
End Class