Monday, September 20, 2010

Fidn the value

BEGIN
    Prompt User to enter a certain amount of numbers
    Set d as amount of numbers in the list
    Set k as test variable
    Assign a value v to k
    Assign k to drop down the list d amount of times
    For each variable check if k encounters a d that is the same value
    loop d amount of times.
    If k = v then return yes
    If k != v then return no
END

This will work because when k goes down the list it either will or will not encounter a v that is the same value.

This will end because when program reaches d amount of times the program will end.

  

No comments:

Post a Comment