Results 1 to 3 of 3

Thread: pseudo code (help)

  1. #1
    Registered+
    Join Date
    Aug 2012
    Posts
    23
    Thanks
    2
    Thanked
    0 times in 0 posts

    pseudo code (help)

    Not really sure if anyone can help me but i doing this project and i have to make my coding into Pseudo Code and struggling on making my code Pseudo just wondering could anyone help me out?

    I have to make it Standard English

    Code:
    Public Class FrmTotal
        Dim price As Single
        Dim price1 As Single
        Dim price2 As Single
        Dim itemlist(0 To 9) As String
        Dim pricelist(0 To 9) As Single
        Dim qntylist(0 To 9) As Single
        Dim totallist(0 To 9) As Single
        Dim number As Single
        Dim total As Single
        Dim PizzaCombo As Single
        Dim DrinksCombo As Single
        Dim credit As Single
        Dim discount As Single
        Dim pass As Single
        Dim takeaway As Single
        Dim subtotal As Single
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboBox1.SelectedIndexChanged
    
            If CboBox1.Text = "Margherita" Then
                price = 2.5
            ElseIf CboBox1.Text = "Garlic Mushroom" Then
                price = 3.5
            ElseIf CboBox1.Text = "Hot Mexican Special" Then
                price = 3.9
            ElseIf CboBox1.Text = "Pepperoni" Then
                price = 4.5
            ElseIf CboBox1.Text = "Tuna" Then
                price = 3.9
            End If
    
        End Sub
    
        Private Sub CboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboBox2.SelectedIndexChanged
    
            If CboBox2.Text = "Plain Burger" Then
                price1 = 2.2
            ElseIf CboBox2.Text = "Cheese Burger" Then
                price1 = 2.4
            ElseIf CboBox2.Text = "Spicy Chicken Grilled Burger" Then
                price1 = 2.8
            ElseIf CboBox2.Text = "Chilli Burger" Then
                price1 = 2.5
    
            End If
        End Sub
    
        Private Sub CboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboBox3.SelectedIndexChanged
    
            If CboBox3.Text = "All soft drink cans" Then
                price2 = 0.9
            ElseIf CboBox3.Text = "1.5 Litre Bottles" Then
                price2 = 2.25
            End If
    
        End Sub
    
        Private Sub BtnOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOrder.Click
    
            FrmQnty.Show()
            FrmKitchen.Show()
            For i As Byte = 0 To number - 1
                FrmQnty.LblOrdered.Text = FrmQnty.LblOrdered.Text & itemlist(i) & vbCrLf
                FrmQnty.LblItemPrice.Text = FrmQnty.LblItemPrice.Text & Format(pricelist(i), "currency") & vbCrLf
                FrmQnty.LblQnty.Text = FrmQnty.LblQnty.Text & qntylist(i) & vbCrLf
                FrmKitchen.LblKitchenshow.Text = FrmKitchen.LblKitchenshow.Text & itemlist(i) & vbCrLf
                FrmKitchen.LblQnty.Text = FrmKitchen.LblQnty.Text & qntylist(i) & vbCrLf
            Next
            FrmQnty.LblTotal.Text = "Total is " & Format(total, "currency")
    
            If ChkCredit.Checked = True Then
                credit = total * 0.03
            End If
            FrmQnty.LblCredit.Text = "Credit charge is  " & Format(credit, "Currency")
    
            If ChkVoucher.Checked = True Then
                discount = total * 0.05
            End If
            FrmQnty.LblVoucher.Text = "Voucher is " & Format(discount, "Currency")
    
    
            If ChkSeason.Checked = True Then
                pass = total * 0.1
                FrmQnty.LblPass.Text = "Pass Discount " & Format(pass, "Currency")
            End If
    
    
            takeaway = discount + pass
            FrmQnty.LblDiscountTotal.Text = "Total Discount " & Format(takeaway, "Currency")
    
    
    
            subtotal = total - takeaway + credit
            FrmQnty.Lblsubtotal.Text = " Sub Total us " & Format(subtotal, "Currency")
    
    
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnDrink.Click
    
            itemlist(number) = CboBox3.Text
            qntylist(number) = Cbo3.Text
            pricelist(number) = price2
            total = qntylist(number) * pricelist(number) + total
            number = number + 1
            LblTotal.Text = total
    
            LblTotal.Text = "Total Price " & Format(total, "Currency")
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBurgers.Click
    
            itemlist(number) = CboBox2.Text
            qntylist(number) = Cbo2.Text
            pricelist(number) = price1
            total = qntylist(number) * pricelist(number) + total
            number = number + 1
            LblTotal.Text = total
    
            LblTotal.Text = "Total Price " & Format(total, "Currency")
    
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPizza.Click
    
            itemlist(number) = CboBox1.Text
            qntylist(number) = Cbo1.Text
            pricelist(number) = price
            total = qntylist(number) * pricelist(number) + total
            number = number + 1
            LblTotal.Text = total
    
            LblTotal.Text = "Total Price " & Format(total, "Currency")
    
        End Sub
    
        Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClose.Click
    
            Me.Close()
    
        End Sub
    End Class

  2. #2
    Registered User
    Join Date
    Jan 2013
    Location
    On the Beachs of Super Sunny Southern California USA
    Posts
    14
    Thanks
    0
    Thanked
    5 times in 3 posts
    • tallship's system
      • Motherboard:
      • HP Proliant DL360G6
      • CPU:
      • 2x Quad Core Xeon
      • Memory:
      • 64GB
      • Storage:
      • iSCSI SAN
      • Case:
      • 1U 19" Rackmount
      • Operating System:
      • Linboard Linux
      • Internet:
      • 1Gbps

    Cool Re: pseudo code (help)

    It appears that what you have suffices nicely. You're able to walk through the code and follow along without error - right?

    One thing, that might help you out is that pseudocode is traditionally written ALGOL style, so you may also want to investigate shell scripts, since it's very ALGOL like. You can even use shell scripts for prototyping as many do, and when that doesn't quite fit your needs you can use Perl too.

    I hope that helps!

    Kindest regards,

    .
    Last edited by tallship; 13-01-2013 at 02:07 PM. Reason: maek pritty

  3. #3
    Registered+
    Join Date
    Aug 2012
    Posts
    23
    Thanks
    2
    Thanked
    0 times in 0 posts

    Re: pseudo code (help)

    cool thanks, I'll take a look at Shell scripts

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •