Results 1 to 2 of 2

Thread: hi someone help pls

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    1

    hi someone help pls

    I have these questions which i can't get my head round. Can someone show me the workings and thus the answers PLEASE!

    For the algorithm below, state the values of Total and Number that would be printed.

    Start
    Number !2
    Total ! Number
    While Number ≤ Total
    Total ! Total + Number
    Number ! Number * Number
    End While
    Print Total, Number
    End

    Total
    Number



    QUESTION 2

    A computerised machine sorts fruit by weight. It uses a program that directs the fruit through three different gates according to weight. Below is a small segment of that program.

    message ! “Fruit is undersized”
    fruit_count ! 0
    Repeat
    good_fruit ! true
    Close all gates
    Input (fruit_weight)
    If (fruit_weight > 30.00) then
    Open (gate1)
    fruit_count ! fruit_count + 1
    Else
    If (fruit_weight > 20.00) then
    Open (gate2)
    fruit_count ! fruit_count + 1
    Else
    good_fruit ! false
    Open (gate3)
    Endif
    Endif
    If not (good_fruit) then
    Output (message)
    Endif
    Until eof ***end of fruit
    Output (fruit_count)

    a. Identify each variable shown in the table below as one of the following variable types: text, date, boolean, integer, floating point.

    Variable Type
    fruit_count
    message
    good_fruit

    Can anyone help me here ... i've been working on this and looked at a few books? I need the workings pls?

    Many thanks

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: hi someone help pls

    We're not going to do your homework so don't even bother. We will, however, help you through your questions as long as you can show some effort. We won't give you the answers but what have you done so far? What don't you understand?

    If you're only looking for someone to give you the answers then I'd suggest studying or dropping the class as you won't learn anything with the answers handed to you.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

Posting Permissions

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



Click Here to Expand Forum to Full Width