End of Unit Quiz – Unit 2.3 Producing robust programs
1.
ai. Maintainability of code allows a team of Programmers to work effectively. One way of improving maintainability of code is to use comments. What is meant by using comments in code?
aii. Explain using an example why you should use comments in code.
bi. Another way of improving maintainability of code is to use indentation. What is meant by indentation?
bii. Why should you use indentation? Give an example.
Version 1 1 © OCR 2017
2.
a. Why is it important that a business has robust validation on their registration web page?
b. What are two examples of validation that a business can implement on their registration page?
3.
The program below outputs the correct size of football for a certain age using the information from the table. The program should also output the circumference and weight.
Age
Circumference (cm)
Weight (g)
Size
<8
58
311
3
9-11
64
369
4
12+
70
425
5
01 Input age
02 Select age
03 Case Is >12
04 Size=5
05 Weight=311
06 Circumference=58
07 Case Is >8 AND <=11
08 Size=4
09 Weight=369
10 Circumference=64
11 Case Is <=8
12 Size=3
13 Weight=311
14 Circumference=58
15 End Select
16 Ball_Info=”The correct size is:” & ” “ & size & “ “ & “With a Circumference of” & Circumference & “ “ _& “and a weight of” & “ “ & weight &”.”
17 OUTPUT BallInfo
ai. What line is the Syntax error is on?
aii. Justify your answer for (ai).
bi. What line is the Logic error on?
bii. Justify your answer for (bi).
4. What is the purpose of testing?
5.
a. How could a software company use iterative testing to develop an app?
b. How could the software company use final testing to develop the product?
6. Complete the definitions for the types of testing below:
Test Data
Reason for use
Valid data
Invalid data
Borderline data
7. John has to write a program to convert exam marks out of 100 to a Grade.
A=80+, B=70-79, C=60-69, D=50-59, E=40-49, F=30-39, G=20-29, U=0-19
Complete the table below by stating the marks to be tested, the reason for test and the expected outcome. The first row has been completed for you.
Test Data
Reason for test
Expected outcome
Mark 78
Test a valid input between 0-100 to check the correct grade is output.
B
Mark……
Mark……
8. When designing computer systems it is important to plan for contingencies. This is very important because it will allow developers to account for situations that were not planned.
What are two situations that might occur and what contingency could be planned to account for them?
9. Software can be misused in a number of ways. The table below lists statements that state acceptable use or software misuse. Tick one box in each row to show which use applies.
Use
Acceptable Use
Software Misuse
Making a copy of licensed software to give to a friend.
Changing the default settings to suit your personal needs.
Copying company data onto a secondary storage device
Using somebody els...