Programming
258 questions. Open a question to solve it and check the official answer.
Programming basics · 16 marks · official answer ready
(c) Two new modules are defined, which will allow two users to exchange messages. Module Description • takes two parameters: Transmit() ○ a string representing a message (already …
Constructs · 12 marks · official answer ready
(d) Module GetData() returns the data field from a message that has been received. If no message is available, the module waits until one has been received. Explain the limitation…
Structured programming · 2 marks · official answer ready
(ii) Write program code to call the function IterativeVowels() with the parameter "house" from the main program. Output the return value. Save your program. Copy and paste the pro…
Structured programming · 1 mark · official answer ready
(ii) Write program code to call the function RecursiveVowels() with the parameter "imagine" from the main program. Output the return value. Save your program. Copy and paste the p…
Constructs · 5 marks · official answer ready
6 An interrupt is generated when a key is pressed on a computer keyboard. Explain how the computer handles this interrupt. ........................................................…
Constructs · 4 marks · official answer ready
(a) Describe how a typical Integrated Development Environment (IDE) could be used to help debug the program to find the errors in the function Calculate(). .......................…
Constructs · 6 marks · official answer ready
6 A video-conferencing program supports up to six users. Speech from each user is sampled and digitised (converted from analogue to digital). Digitised values are stored in array …
Constructs · 7 marks · official answer ready
(b) A new module has been defined: Module Description CheckNewItem() • called with a parameter of type string representing a line of item information • checks to see whether an it…
Constructs · 3 marks · official answer ready
(e) A new module FindItem() searches for a given item in the Stock.txt file, which is already organised in ascending order of ItemNum. Describe how this organisation may improve t…
Constructs · 1 mark · official answer ready
(i) Identify a more appropriate way of representing the postal costs. .............................................................................................................…
Constructs · 3 marks · official answer ready
(b) The lines of pseudocode contain features that make them easier to understand. State three of these features. 1 ................................................................…
Constructs · 2 marks · official answer ready
(b) MyDOB has been assigned a valid value representing the user’s date of birth. Write a pseudocode statement to calculate the number of months from the month of the user’s birth …
Structured programming · 3 marks
(a) Explain why the program gives unexpected results. .............................................................................................................................…
Structured programming · 3 marks
(c) Describe how a typical Integrated Development Environment (IDE) could be used to identify this error. .........................................................................…
Structured programming · 7 marks
11 Num 1.0 ... 40 REPEAT 41 CALL DisplaySqrt(Num) 42 Num Num + 1.0 43 UNTIL Num > 10 ... 50 PROCEDURE DisplaySqrt(BYREF ThisNum : REAL) 51 OUTPUT ThisNum 52 ThisNum SQRT(ThisNum) …
Constructs · 10 marks
(i) State three items of information that the new module would need. Justify your choice in each case. Information ................................................................…
Constructs · 20 marks
(ii) Identify two items of customer information that would not be required by the new module. Justify your choice in each case. Information .......................................…
Constructs · 2 marks · official answer ready
(a) MyDOB has been assigned a valid value corresponding to Kevin’s date of birth. Complete the pseudocode statement to test whether Kevin was born on a Thursday. IF ..............…
Structured programming · 2 marks · official answer ready
(i) Two of the parameter values can be checked without reference to the third parameter. Describe these two checks. Check 1 .......................................................…
Structured programming · 2 marks · official answer ready
(ii) Several values of the parameter representing the day can only be checked completely by referring to the value of one other parameter. Describe this check. ...................…
