Monday, 17 September 2012

Luck Pizza Pseudo & Programming Code


Pseudo Code

On button ‘calculate’ click

-Check whether radio button checked

          -If yes, +0.6

          - If No, No action

-Display amount $6.95 +radio button

 

On button ‘clear’ click

-          Reset radio buttons

-          Reset lblPrice

 

On button ‘Exit’ click

-          End program
The pseudocode display the key aspects of the program. All key features of the Luck Pizza program is displayed on this code. The basic functions such as the 'exit' button is standard as with outer programs created on Visual Basic.


Program Code

Public

Class Form1


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


End


End Sub


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


End Sub


Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click


Dim sngcost As Single

sngcost = 7


If chkAnch.Checked = True Then

sngcost = sngcost + 0.6


End If

lblPrice.Text = Format(sngcost,
"Currency")


End Sub


Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click


End Sub

End

Class

Private

Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear_Click.

radhaw.checked

chkanch.checked =

False

chkchil.checked =
False

chkexch.checked =
False

chksal.checked =
False

lblPrice.Text=$6.95


End

Sub

No comments:

Post a Comment