Programming
221 questions. Open a question to solve it and check the official answer.
Programming concepts · 4 marks · official answer ready
6 An incomplete algorithm has been written in pseudocode to count the number of values stored in an array and to find their average. Values have been stored in the array starting …
Programming concepts · 4 marks · official answer ready
6 An incomplete algorithm has been written in pseudocode to count the number of values stored in an array and to find their average. Values have been stored in the array starting …
Programming concepts · 0 marks
14 WHILE NOT Found AND Accept AND Index < LENGTH(Password)
Programming concepts · 0 marks
15 IF SUBSTRING(Password, Index, 1) = '!'
Programming concepts · 4 marks · official answer ready
(c) The table contains different types of sensors and a use for each. Complete the table by giving a suitable use for each type of sensor. The first one has been done for you. typ…
Programming concepts · 4 marks · official answer ready
(a) Draw one line to link each description to the most appropriate programming concept. Not all programming concepts will be used. Description Programming concept function a subro…
Programming concepts · 2 marks · official answer ready
(b) Write the pseudocode to use a procedure named Average that passes the values 25 and 50 to the procedure. ......................................................................…
Programming concepts · 3 marks · official answer ready
(c) Outline the role of procedures and functions in creating a program that is easier to maintain. ................................................................................…
Programming concepts · 4 marks · official answer ready
3 State what is meant by the data types integer and real. Give an example of each. Integer ........................................................................................…
Programming concepts · 4 marks · official answer ready
(c) Explain how you should alter the original corrected algorithm to make sure that all the numbers entered are between 1 and 500 inclusive. If any numbers fall outside these limi…
Programming concepts · 5 marks · official answer ready
5 Write the pseudocode statements to perform this task: • accept the input of a whole number from 1 to 4 inclusive • use a CASE statement to: ○ output the number (1 to 4 inclusive…
Programming concepts · 4 marks · official answer ready
(b) The function LENGTH(X) calculates the length of a string X Write the pseudocode statements to: • read the contents of the text file Quotation.txt into an appropriate string va…
Arrays · 15 marks · official answer ready
10 The one-dimensional (1D) array Clubs[] is used to store the names of 12 cricket clubs in a local sports league. The two-dimensional (2D) array Statistics[] is used to store, fo…
Programming concepts · 2 marks · official answer ready
(i) Write the pseudocode to make sure that the product code is six characters in length. ..........................................................................................…
Programming concepts · 2 marks · official answer ready
(ii) Write the pseudocode to make sure that the first two characters of the product code are “PD”. ................................................................................…
Programming concepts · 6 marks · official answer ready
5 A high-level programming language makes use of arithmetic, Boolean and logical operators. State how each type of operator is used. Give an example statement, in pseudocode, for …
Programming concepts · 4 marks · official answer ready
(a) Write an algorithm in pseudocode to total the numbers input and to output the total. You do not need to validate the input. ...................................................…
Programming concepts · 4 marks · official answer ready
(b) Write an algorithm in pseudocode to count and output the number of input values that are greater than 100. You do not need to validate the input. .............................…
Arrays · 5 marks · official answer ready
(a) Give a line number for each of these types of statement: Assignment statement .................................................................................................…
Arrays · 15 marks · official answer ready
11 A one-player game uses the two-dimensional (2D) array Grid[] to store the location of a secret cell to be found by the player in 10 moves. Each row and column has 5 cells. Star…
