Photo AI

CoasterRocks theme park is running an online competition to win a free family ticket - Scottish Highers Computing Science - Question 18 - 2019

Question icon

Question 18

CoasterRocks-theme-park-is-running-an-online-competition-to-win-a-free-family-ticket-Scottish Highers Computing Science-Question 18-2019.png

CoasterRocks theme park is running an online competition to win a free family ticket. People visit the web page and enter their email. Email: Confirm email: Only ... show full transcript

Worked Solution & Example Answer:CoasterRocks theme park is running an online competition to win a free family ticket - Scottish Highers Computing Science - Question 18 - 2019

Step 1

Identify from the code shown above (i) a formal parameter

96%

114 rated

Answer

In the code, a formal parameter is found in the procedure removeDuplicates, specifically the parameters ARRAY OF STRING_list and ARRAY OF STRING newList. These are the parameters that the procedure accepts.

Step 2

Identify from the code shown above (ii) an actual parameter

99%

104 rated

Answer

An actual parameter used in the invocation of the procedure is emails when the procedure removeDuplicates(emails, uniques) is called.

Step 3

Explain what is meant by the scope of a variable.

96%

101 rated

Answer

The scope of a variable refers to the regions of a program in which the variable can be accessed or is visible. It determines where the variable can be used or modified within that program.

Step 4

State the scope of the variable emails.

98%

120 rated

Answer

The variable emails has a global scope, meaning it can be accessed and used throughout the entire program, from its declaration until the end of the program.

Step 5

A breakpoint has been set at Line 77. The variables in the table below are inspected. Complete the table to show the values stored.

97%

117 rated

Answer

VariableValue
position1
newList[position]bert@yehea.com
list[index]colin@iclood.com

Step 6

Explain the operation of lines 74 to 76 during the first iteration of the loop.

97%

121 rated

Answer

During the first iteration of the loop (when index = 1), lines 74 to 76 check if the current item in the list, list[1], which is bert@yehea.com, is not in newList[position], which currently holds the first unique entry. Since they match, the condition is false and the program does not add this email to newList.

Step 7

The theme park is aware that their website might be subjected to a DOS attack. State the effect on customers of a DOS attack.

96%

114 rated

Answer

A DOS (Denial of Service) attack can lead to slow performance of the website or even complete unavailability. This means that customers may experience delays when trying to submit entries or may be unable to access the site altogether.

Join the Scottish Highers students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;