Task 1 Task 2 Task 3
Task 1 Task 2 Task 3
Random Name

Task 1

Here is a flowchart. Look at the loop. Can you see how it is being controlled? What kind of loop is this?

 

Code it in Java.

Random Name

Task 2

Here is a flowchart. Can you see how the loop is being controlled? What kind of loop does it represent?

 

Code it in Java.

Random Name

Task 3

Here is a program written in PSEUDOCODE. Can you represent it using a flowchart?

array = [1,4,2,3,5,7,6,0,8,9]

index = -1

input searchItem

loop for i from 0 to 9

if array[i] = searchItem then

index = i

end if

end loop

 

if index = -1 then

output "item not found"

else

output "item found at index ", index

end if