Question: 7 . 2 T M Hand Execution - Arrays - Part 2 In this task we again hand execute a program using trace tables. This
T M Hand Execution Arrays Part
In this task we again hand execute a program using trace tables. This task also involves arrays.
The following is an example of how to represent an array for your hand execution using a trace table:
Tip: It is useful to include the indexes above the data. This will help make it easy to lookup the values in the array.
def whatshouldthisfunctionbecalled?data val
i
result false
while i data.length
if datai val
result true
return result
end
i i
end
Complete a trace table using the answer sheet for the following two arrays and parameter values:
Use this answer sheet:
File
Tutorial Task Hand execution Array Search.docx
Upload to the Ed workspace a document or photo of your answer sheets showing:
a trace table showing the workings of your hand execution
the answer for the data provided
the name you chose for the function in the code above.
Suggestion as to how the design of the code could be improved in line with structured principles?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
