Pseudocode
Pseudocode
pseudocode Task
1 A = 5
else
end if
STR2 = "blue"
STR1 = "blue"
end if
output STR1
output COUNT
COUNT = COUNT + 2
end loop
4 COUNT = 0 SUM=45
SUM = 0
COUNT = COUNT + 1
end loop
5 loop X from 1 to 10
if X mod 2 = 0 then
else
output "odd"
end if
end loop
6 loop X from 0 to ARRAY.length - 1 array.length - 1
TEMP = ARRAY[X + 1]
ARRAY[X + 1] = ARRAY[X]
ARRAY[X] = TEMP
end if
end loop
flowchart pseudocode
7 A = 5
B = 10
if A < B then
else
end if
A=1
loop A from 1 to 10
if A mod 2 = 0 then
output "A"
else
A=A+1
9
X=0
while loop
SUM=SUM+ARRAY[X]
X=X+1
10. Determine if two numbers are equal. If they are equal print "same" otherwise print "different".
A=int
B=int
11. A method returns true if a given string contains the letter "a" otherwise it returns false.
A=str
if B=”a”, true
else false
12. A method returns true if a given number is prime otherwise it returns false. A number is prime if it
is only divisible by itself and one.
i = int
if (i/i=1) true
else false