Professional Documents
Culture Documents
Soo Dough Praktis
Soo Dough Praktis
1. I used python indexing rather than pseudo code indexing because of the Hint in question
missing_char.
2. Question string_bits requires error handling since an indexing error may come up if there are even
number of characters in the string. I don't know how to hadnle errors in pseudo code.
3. May be less than 4 means cannot be more than four? I made program considering that there will be 4
or less
sleep_in
DECLARE is : BOOLEAN
is <-- TRUE
THEN
is <-- TRUE
ELSE
is <-- FALSE
END IF
RETURN is
ENDFUNCTION
monkey_trouble
THEN
ELSE
END IF
RETURN trouble
ENDFUNCTION
sum_double
IF One = Two
THEN
ELSE
END IF
RETURN sum
ENDFUNCTION
diff21
DECLARE difference
IF n > 21
THEN
ELSE
difference <-- 21 - n
RETURN difference
ENDFUNCTION
parrot_trouble
IF talking = TRUE AND hour < 7 OR talking = TRUE AND hour > 20:
THEN
THEN
ELSE
ENDIF
ELSE
ENDIF
RETURN trouble
ENDFUNCTION
makes_10
IF sum = 10 OR a = 10 OR b = 10
THEN
ELSE
ENDIF
RETURN answer
ENDFUNCTION
near_hundred
THEN
ELSE
ENDIF
RETURN check
ENDFUNCTION
pos_neg
anchor <-- 0
IF negative = TRUE
THEN
IF Oneans < 0 AND Twoans > 0 OR Oneans > 0 AND Twoans < 0
THEN
ELSE
ENDIF
RETURN answer
ENDFUNCTION
not_string
DECLARE new_string
IF string[0] = "n" AND string[1] = "o" AND string[2] = "t" AND string[3] = " "
THEN
ELSE
ENDIF
RETURN new_string
ENDFUNCTION
missing_char
IF n = 0
THEN
ELSE
IF n = LENGTH(string)-1
THEN
ELSE
ENDIF
ENDIF
RETURN new_string
ENDFUNCTION
front_back
NEXT FOR
RETURN newstr
ENDFUNCTION
front3
NEXT FOR
RETURN front
ENDFUNCTION
front_times
IF LENGTH(string) > 3
THEN
NEXT FOR
ELSE
NEXT counter
RETURN front
ENDFUNCTION
string_bits
IF index = 0
THEN
ELSE
ENDIF
NEXT index
RETURN new_string
ENDFUNCTION
string_splosion
IF index = 0
THEN
ENDIF
IF index = 1
THEN
ENDIF
IF index = 2
THEN
ENDIF
IF index = 3
THEN
ENDIF
NEXT index
RETURN new_string
ENDFUNCTION
array_count9
no9s <-- 0
IF array[index] = 9:
THEN
ENDIF
NEXT index
RETURN no9s
ENDFUNCTION
array_front9
IF array[number] = 9
THEN
NEXT number
RETURNS 9is
ENDFUNCTION
array123
THEN
ENDIF
NEXT index
RETURN appears
ENDFUNCTION
string_match
DECLARE shortLength
position <-- 0
THEN
shorterLength = LENGTH(b)
ELSE
shorterLength = LENGTH(a)
ENDIF
IF a[index] = a[index+1]
THEN
IF b[index] = b[index+1]
THEN
ELSE
position <-- 0
ENDIF
ENDIF
NEXT index
RETURN position
ENDFUNCTION
hello_name
DECLARE new_string
RETURN new_string
ENDFUNCTTION
make_abba
DECLARE new_string
RETURN new_string
ENDFUNCTION