Programming
295 questions. Open a question to solve it and check the official answer.
Arrays · 15 marks · official answer ready
10 A number game has two players. Random whole numbers are generated for each player. The numbers are compared and players are given points based on the result of the comparison. …
Programming concepts · 1 mark
(a) The image file was taken by a digital camera. Tick (✓) one box to show whether a digital camera is an example of an input, output, process or storage device. A input B output …
Programming concepts · 4 marks · official answer ready
(ii) Give two other functions commonly found in an IDE. State the role of each function. Function 1 ...............................................................................…
Programming concepts · 6 marks · official answer ready
(ii) A patient is making a payment through a secure connection. The secure connection is created using the secure socket layer (SSL) protocol. Explain how a secure connection is c…
Arrays · 4 marks · official answer ready
3 The following pseudocode algorithm uses a count-controlled loop to read in 10 names and store them in the array Names[] FOR Count 1 TO 10 OUTPUT "Please enter a name" INPUT Name…
Programming concepts · 5 marks · official answer ready
(a) Write an algorithm using pseudocode to: • input the telephone number • extract the 2-digit country code • output the matching country • output ‘Unknown’ if there is no matchin…
Programming concepts · 3 marks · official answer ready
(b) Explain how you could change the algorithm to repeatedly prompt for the telephone number until the number entered is 13 characters in length. Any code used must be fully expla…
Programming concepts · 4 marks · official answer ready
5 Two library routines used in programming are MOD and DIV. State the purpose of each of the library routines. Give one example pseudocode statement for each of the library routin…
Programming concepts · 2 marks · official answer ready
(a) Write pseudocode statements to declare the variables A and B ..................................................................................................................…
Programming concepts · 6 marks · official answer ready
(b) The function Odds(X) returns ‘Odd’ if the value of X is an odd number and returns ‘Even’ if the value of X is an even number. Write pseudocode statements to: • define the func…
Arrays · 15 marks · official answer ready
11 The one-dimensional (1D) array CompetitorName[] contains the names of 25 competitors in a tournament that includes five events. Another two-dimensional (2D) array CompetitorSco…
Programming concepts · 3 marks · official answer ready
2 A fence measuring 2 metres in height and 20 metres in length needs painting. The area of the fence needs to be calculated so that enough paint for the job is purchased. After th…
Arrays · 2 marks · official answer ready
(b) Write the pseudocode statement that will output the average height rounded to one decimal place. ..............................................................................…
Programming concepts · 4 marks · official answer ready
(c) Explain how you could change the corrected algorithm so that it will also: • find the height of the tallest person. • output the height of the tallest person at the end of the…
Programming concepts · 1 mark · official answer ready
(b) State the purpose of the algorithm on page 6. .................................................................................................................................…
Programming concepts · 3 marks · official answer ready
(c) Explain how the algorithm knows when all the letters in the word have been checked so that it can stop checking. ..............................................................…
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 ........................................................................................…
