Win BIG with HabboxStarz!
Show off your musical talent in our old skool singing competition! Big prizes to be won!
HxSS Awards winners and final standings!
It's all done! Click here to see the big big winners from this year's tournament, and the fan favourites for the awards!
Check out HabboxWiki!
The biggest and best archive of all things Habbo - could YOU be our next top editor?


Results 1 to 7 of 7

Thread: Pseudo code

  1. #1
    Join Date
    Dec 2008
    Location
    South Wales
    Posts
    8,911
    Tokens
    7,620
    Habbo
    J25T

    Latest Awards:

    Default Pseudo code

    I need help, need to create a pseudo code on the following question.

    An online shop has delivery charges of £2.99 for sales up to £20, £4.99 for sales between £20 and £50. Delivery is free for sales more than £50.

    For sales of a single item a programme is to be written that inputs the unit cost of an item and the quantity purchased and calculates and outputs the total cost of the order.
    Tried and could not do it. Hate pseudo codes

  2. #2
    Join Date
    Jul 2005
    Location
    North Wales
    Posts
    4,233
    Tokens
    1,544

    Latest Awards:

    Default

    A level computing? Pseudo code annoyed the hell out of me, just write out how you would in what ever language your most comfortable with and convert it to Pseudo.

  3. #3
    Join Date
    Dec 2008
    Location
    South Wales
    Posts
    8,911
    Tokens
    7,620
    Habbo
    J25T

    Latest Awards:

    Default

    I done it then, thanks though!
    And I do National Diploma ICT, Programming is a unit

  4. #4
    Join Date
    Apr 2006
    Location
    Lichfield
    Posts
    4,302
    Tokens
    1,643

    Latest Awards:

    Default

    Code:
    itemprice = keyboard input
    delivery20 = 2.99
    delivery20to50 = 4.99
    deliveryfree = 0
    
    
    
    input item price
    
    
    
    if itemprice < 20 
    
    then 
    
    output itemprice + delivery20
    
    
    
    else if itemprice >= 20 <=50
    
    then
    
    output itemprice + delivery50
    
    
    
    else
    
    output itemprice + deliveryfree

    Something like that anyway.
    Last edited by Stephen!; 17-01-2011 at 06:42 PM.

  5. #5
    Join Date
    Dec 2008
    Location
    South Wales
    Posts
    8,911
    Tokens
    7,620
    Habbo
    J25T

    Latest Awards:

    Default

    Quote Originally Posted by Stephen View Post
    Code:
    itemprice = keyboard input
    delivery20 = 2.99
    delivery20to50 = 4.99
    deliveryfree = 0
    
    
    
    input item price
    
    
    
    if itemprice < 20 
    
    then 
    
    output itemprice + delivery20
    
    
    
    else if itemprice >= 20 <=50
    
    then
    
    output itemprice + delivery50
    
    
    
    else
    
    output itemprice + deliveryfree

    Something like that anyway.
    Mine was kind of like that, a bit more simple though

    Code:
     BEGIN
           Input cost of sale
    Delivery = £2.99
    IF cost of sale > £20 and < £50
    Delivery = £4.99
    If cost of sale > £50
    Delivery = £0.00
           Output delivery cost
    END

  6. #6
    Join Date
    Apr 2006
    Location
    Lichfield
    Posts
    4,302
    Tokens
    1,643

    Latest Awards:

    Default

    You have no variables

    But yeah, that's it in it's most basic form.

    Mine would be easier to write out in whatever language you need.

  7. #7
    Join Date
    Dec 2008
    Location
    South Wales
    Posts
    8,911
    Tokens
    7,620
    Habbo
    J25T

    Latest Awards:

    Default

    We're not really going to write it in a language. It's just homework really, where working on pseudo codes.

Posting Permissions

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