Question: 7 . 2 T M Hand Execution - Arrays - Part 2 In this task we again hand execute a program using trace tables. This

7.2T M Hand Execution - Arrays - Part 2
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.
123456789101112
def whatshouldthisfunctionbecalled?(data, val)
i =0
result = false
while i < data.length
if data[i]== val
result = true
return result
end
i = i +1
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:
1. a trace table showing the workings of your hand execution
2. the answer for the data provided
3. the name you chose for the function in the code above.
4. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!