Earlier this month, you wrote your final mini-test of the year – focused on being able to explain how an array and a function work within a view model.

Depending on the sheet you received, you wrote one of three versions:

VersionColour of paper
AYellow
BPink
CBlue

Please use the navigation panel at right to review answers for the version of the mini-test that you wrote. ➡️

TIP

On the culminating task, you will be asked in your 6-minute interview to answer questions quite similar to the questions posed on this mini-test.

Your responses would be given based on the code that you will write for the culminating task.

It it worth your while to learn these concepts, if you did not do as well as you’d hoped on the mini-test.

If you demonstrate a strong understanding of these concepts during the culminating task interview, Mr. Gordon can apply his professional judgement and overlook a poor mini-test result.

Version A – Yellow

Question 1

Describe the overall purpose of the program.

Question 2

Describe where input and output occur in the running of the program. Identify the specific line(s) of code responsible for each.

Question 3

Identify where data is first stored in an array. Reference the specific line(s) of code that accomplish this.

Question 4

What is the name of the chosen array?

Question 5

Describe where the chosen array is used in the program — for example, where it is iterated over, where individual elements are accessed, or where existing data in the array is used to produce new data or drive behaviour.

Question 6

What does the data stored in the array represent within the program? Describe the type of data stored and what role it plays.

Question 7

Explain how use of the array manages complexity in this program. In your response, explain why the program could not be written — or how it would have to be written differently — if the array were not used.

Question 8

Identify where a function is defined in the program. What is the function’s name? What is its return type, if any? What are the names of any parameter(s) and the data type of the parameter(s)?

Question 9

Where is this function called (invoked, or used) within the program?

Question 10

What is the purpose of the function, and how does it contribute to the overall functionality of the program?

Question 11

Use point-form English to explain how the function uses sequence, selection, and iteration to accomplish its purpose. Your explanation should be detailed enough for someone else to reproduce the function. Please do not simply repeat back the lines of code that exist in the function.

Question 12

Look at the provided screenshots. Now, describe a scenario where two separate calls to the function result in the outcomes shown in two of the screenshots. What would the arguments to the function have been in each case?

Question 13

Given the two situations you described in question 12, what conditions would be tested within the function? How do different arguments change what happens inside the function?

Question 14

Given the two situations you described in questions 12 and 13, what would the result of each situation be? In other words, what is returned from the function in each case?

Version B – Pink

Question 1

Describe the overall purpose of the program.

Question 2

Describe where input and output occur in the running of the program. Identify the specific line(s) of code responsible for each.

Question 3

Identify where data is first stored in an array. Reference the specific line(s) of code that accomplish this.

Question 4

What is the name of the chosen array?

Question 5

Describe where the chosen array is used in the program — for example, where it is iterated over, where individual elements are accessed, or where existing data in the array is used to produce new data or drive behaviour.

Question 6

What does the data stored in the array represent within the program? Describe the type of data stored and what role it plays.

Question 7

Explain how use of the array manages complexity in this program. In your response, explain why the program could not be written — or how it would have to be written differently — if the array were not used.

Question 8

Identify where a function is defined in the program. What is the function’s name? What is its return type, if any? What are the names of any parameter(s) and the data type of the parameter(s)?

Question 9

Where is this function called (invoked, or used) within the program?

Question 10

What is the purpose of the function, and how does it contribute to the overall functionality of the program?

Question 11

Use point-form English to explain how the function uses sequence, selection, and iteration to accomplish its purpose. Your explanation should be detailed enough for someone else to reproduce the function. Please do not simply repeat back the lines of code that exist in the function.

Question 12

Look at the provided screenshots. Now, describe a scenario where two separate calls to the function result in the outcomes shown in two of the screenshots. What would the arguments to the function have been in each case?

Question 13

Given the two situations you described in question 12, what conditions would be tested within the function? How do different arguments change what happens inside the function?

Question 14

Given the two situations you described in questions 12 and 13, what would the result of each situation be? In other words, what is returned from the function in each case?

Version C – Blue

Question 1

Describe the overall purpose of the program.

Question 2

Describe where input and output occur in the running of the program. Identify the specific line(s) of code responsible for each.

Question 3

Identify where data is first stored in an array. Reference the specific line(s) of code that accomplish this.

Question 4

What is the name of the chosen array?

Question 5

Describe where the chosen array is used in the program — for example, where it is iterated over, where individual elements are accessed, or where existing data in the array is used to produce new data or drive behaviour.

Question 6

What does the data stored in the array represent within the program? Describe the type of data stored and what role it plays.

Question 7

Explain how use of the array manages complexity in this program. In your response, explain why the program could not be written — or how it would have to be written differently — if the array were not used.

Question 8

Identify where a function is defined in the program. What is the function’s name? What is its return type, if any? What are the names of any parameter(s) and the data type of the parameter(s)?

Question 9

Where is this function called (invoked, or used) within the program?

Question 10

What is the purpose of the function, and how does it contribute to the overall functionality of the program?

Question 11

Use point-form English to explain how the function uses sequence, selection, and iteration to accomplish its purpose. Your explanation should be detailed enough for someone else to reproduce the function. Please do not simply repeat back the lines of code that exist in the function.

Question 12

Look at the provided screenshots. Now, describe a scenario where two separate calls to the function result in the outcomes shown in two of the screenshots. What would the arguments to the function have been in each case?

Question 13

Given the two situations you described in question 12, what conditions would be tested within the function? How do different arguments change what happens inside the function?

Question 14

Given the two situations you described in questions 12 and 13, what would the result of each situation be? In other words, what is returned from the function in each case?