Sit 106 Programming Methodology 3
Sit 106 Programming Methodology 3
vi) x 2 + y2 (2 marks)
vii) e x + m n (2 marks)
a) Give two examples of system software and explain their use (4 marks)
b) Using a diagram explain the Von Neumann architecture of a computer system (6 marks)
c) Consider the following programming statements.
int x = 2, n = 6, p = 1;
for (int i = 1; i <= n; ++i){
p = p * x;
cout << p << endl;}}
i) What is the output value? (3 mark)
ii) Express the output value as a function of x (2 marks)
iii) Draw a flow chart diagram to represent the program above (5 marks)
if (n%2 == 1) p = p * x;
a) Use the table below to construct a nested if statement to print the string of characters
given the conditions (6 marks)
P>=Q P<Q