# need help write pseudocode



## mad19 (Aug 25, 2009)

i have 8 forms to do so i need as much help as i can get 
1st form is the log in 

user name "textbox1"
password "textbox2"

log in clear 

the vb code is If TextBox1.Text = "12" And TextBox2.Text = "1234" Then
Form4.Show()
Else : MsgBox("Incorrect User name or Password", MsgBoxStyle.Critical, "")

End If
If TextBox1.Text = "" And TextBox2.Text = "" Then
MsgBox("PLEASE ENTER USERNAME OR PASSWORD", MsgBoxStyle.Critical, "")

End If

the pseudocode i did was 

begin 
username:integer
password : integer
IF textbox1 = 12 AND textbox2 = 1234 THEN 
go to form4
ELSE display "PLEASE ENTER USERNAME OR PASSWORD"

END IF
IF textbox1 = "" OR textbox2 = "" THEN
Display "PLEASE ENTER USERNAME OR PASSWORD"
END IF 

END


is this correct or wrong ??


----------



## Ninjaboi (Dec 27, 2010)

The pseudocode ( jargon ) seems straight-forward to me. I'd recommend you use the tags for your code so it looks better in the forum, but other than that I'd say your jargon is fine.


----------



## dwm260 (Sep 21, 2009)

mad19 said:


> the pseudocode i did was
> 
> begin
> username:integer
> ...


This part is checking whether the user name and password is correct. If they enter something but the password/user name is wrong, you will get the same message that you would get if you didn't enter anything. 

If it were me, I would change that actual output of this condition to "The password or username was unvalid, Please Enter again" or something along those line. 

Hope this helped! 

Good Luck!

Dan


Edit: Actually, if you look above at your first post, this message should actually be a different message than what you have in the pseudo code , therefore solidifying my point. Good Luck!


----------



## mad19 (Aug 25, 2009)

good ting you said that so i will change the error message but will that do for the psuedocode cuase i really not sure the other form i have is a calculation


gross salary textbox1

NIS num2textbox2

PAYE num3textbox3

health Insurance num6textbox6

credit card num7textbox7

othermonthly instal num8textbox8

total deduction textbox4

debit service ratio answerlabel5 

net salary textbox5

unsecure loan value unsecureLabel7


"calculate" "reset"


the VB2008 code is 

Dim answer As Decimal
Dim num2 As Decimal
Dim num3 As Decimal
Dim num6 As Decimal
Dim num7 As Decimal
Dim num8 As Decimal

Try


num2 = Decimal.Parse(num2TextBox2.Text)
num3 = Decimal.Parse(num3TextBox3.Text)
num6 = Decimal.Parse(num6TextBox6.Text)
num7 = Decimal.Parse(num7TextBox7.Text)
num8 = Decimal.Parse(num8TextBox8.Text)




TextBox4.Show()

TextBox4.Text = num2 + num3 + num6 + num7 + num8

answer = TextBox4.Text / TextBox1.Text
answerLabel5.Text = answer.ToString("P1")


TextBox5.Text = TextBox1.Text - TextBox4.Text


If answer <= 40 / 100 Then
MessageBox.Show("CONGRATS!!! You are Qualified For a Loan.. Please continue ")

unsecureLabel7.Text = TextBox5.Text * 3


Else
MessageBox.Show("SORRY, YOU'RE NOT QUALIFIED FOR A LOAN APPLICATION WILL NOW CLOSE")
Me.Hide()


End If

Catch ex As Exception
MessageBox.Show("ERROR!!! enter numeric data")
End Try

End Sub

this is my psuedocode 


BEGIN
num2 As Decimal
num3 As Decimal
num6 As Decimal
num7 As Decimal
num8 As Decimal

ACCEPT num2,num3,num6,num7,num8

DISPLAY
TextBox4.Text := num2 + num3 + num6 + num7 + num8

answer := TextBox4.Text / TextBox1.Text
answerLabel5.Text := answer.ToString("P1")

TextBox5.Text := TextBox1.Text - TextBox4.Text


IF 
answer <= 40 / 100 Then
MessageBox.Show("CONGRATS!!! You are Qualified For a Loan.. Please continue ")

unsecureLabel7.Text := TextBox5.Text * 3


Else
MessageBox.Show("SORRY, YOU'RE NOT QUALIFIED FOR A LOAN APPLICATION WILL NOW CLOSE")
Me.Hide()


End If


IS this CORRECT?/


----------

