mi_H_Computing_all_2011

Page 19

16

Sidney is an experienced programmer. He decides to write a book called “The Good Programming Guide”. (a)

Chapter One of the book is entitled “Characteristics of a well written program”. Two characteristics of a well written program are reliability and efficiency. (i)

Define the term “reliable”.

1 KU

Software performs as predicted on duplicated test runs Software will not stop due to design flaws Output is correct for all specified inputs 1 mark for any valid point. (ii)

Explain one way in which a program can be written to make it efficient in terms of processor usage.

2 PS

No unnecessary code is included in the program (1 mark), processor not required to carry out unnecessary commands (1 mark) Minimise the number of disk accesses/peripherals (1 mark), reducing time processor will have to stand idle (1 mark) Simple user interface (1 mark) as complex interfaces take some time to draw etc (1 mark) Use of Nested IFs/Case statements (1 mark) to logically structure code to avoid testing unnecessary conditions (1 mark) Valid programming example (1 mark) explanation of processor efficiency (1 mark) 2 marks for any valid full description of one point. (b)

A well written program should make use of parameter passing. (i)

State the purpose of an in parameter.

1 KU

Current value (of variable) passed into a subprogram for use To allow data to be passed by value Protect (original value of) variable from change by subprogram 1 mark (ii)

State the purpose of an out parameter.

1 KU

Data/variables (created within procedure and only) passed out of a subprogram Brand new variable is passed out of subprogram 1 mark Page 19


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.