Preview

10 - Past Paper Simulation -Robust Programs (I) #1

 1. Describe Validation (1 mark)

 2. Range Check is one type of validation. Name three other types of validation checks (3 marks)

 3. Explain three different types of error that can occur in a computer program (6 marks)

 4. Maintainability of code allows a team of Programmers to work effectively. One way of improving maintainability of code is to use comments. What are comments and how are they useful? (2 marks)

 5. Another way of improving maintainability of code is to use indentation. What is meant by indentation? Why should you use it? (2 marks)

 6. Why is it important that a business has robust validation on their registration web page? (1 mark)

 7. What are two examples of validation that a business can implement on their registration page? (2 marks)

 8. Give one reason why the following code will result in an error, and state the type of error. (2 marks)
row_data = ['apples', 'pears', 'oranges']

def output_data():
for row_num in range(0, len(row_data)): 
	print(str(row_num) + "..." + row_data[row_num])

output_data()
print(row_num)

 9. Explain three different tools to help programmers detect and deal with errors. (6 marks)

 10. Explain, using examples from the program, two ways Hannah can improve the maintainability of the program. (2 marks)

 11. Music teacher Philip is writing a program for music students. To make sure that there are no logic errors in the program, Philip uses a test plan. Describe what is meant by a logic error. (1 mark)

 12. A local computer business uses card payments with customers. Explain why it is important for computer systems that process card payments to be reliable. (3 marks)

 13. John has used a RoundDown function to remove the decimal part of the division, e.g. RoundDown(6.2) would return 6, RoundDown(7.8) would return 7. There is an error in line 05. Write a corrected line of code to replace line 05. (1 mark)
	
John is an author and programmer, and he needs to estimate how many pages his new book will have.

Each page has an average of 300 words. Each chapter starts with a chapter title page.
The number of pages is estimated by;

dividing the number of words by 300
ignoring the decimal part of the division
adding the number of chapters to this total.

John uses the algorithm below to estimate the number of pages, but his algorithm does not give the correct result.

01	INPUT numberOfWords
02	INPUT numberOfChapters
03	CONST wordsPerPage = 300
04	numberOfPages = RoundDown(numberOfWords / wordsPerPage)
05	numberOfPages = numberOfWords + numberOfChapters
06	OUTPUT numberOfPage

 14. Explain one example of how the robustness of an Internet computer system could be improved. (2 marks)

 15. Give one example of a critical system that needs to be robust. (1 mark)