Question
Bring up the web page scriptTrace.html. Add a break point to the first line of executable code in the function findMin. Run the program using
Bring up the web page scriptTrace.html. Add a break point to the first line of executable code in the function findMin. Run the program using the 1st button. When it stops inside findMin step through the program and answer the following questions. To reset values, reload the page.
a. On a fresh reload of the web page, what is the data type of i before the first call to Math.sqrt? After? (If dont reload the web page the value of i may be from a previous run of the program.)
b. What are the values of position when minItem changes?
c. When position is 2, change the value of list by typing in and executing the following code in the command panel:
list[2.5]= 'Elmer'; list['CENG256]= 'Aaron'; list[-1]= 'Terry';
Continue stepping through the code until the function is complete. Does the code check the new values? If so, when?
scriptTrace.html
These functions are for you to trace as an exercise
The functions below are used in class as examples to trace
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started