The following program uses the Square(n) function to draw a pattern.
Two values have been missed out from the code.
Complete the code by filling in the values in the two boxes. (2)
The following program uses the Square(n) function to draw a pattern.
Two values have been missed out from the code.
Complete the code by filling in the values in the two boxes. (2)
A programming language provides the following pre-defined functions.
move(n) = distance moved in pixels
rotate(d) = degrees turned (positive means clockwise)
These can be used by the programmer to draw lines.
A programmer writes the code to draw a square. The code is shown below.
Suggest a new pre-defined function that could be added to this programming language. (1)
A programming language provides the following pre-defined functions.
move(n) = distance moved in pixels
rotate(d) = degrees turned (positive means clockwise)
These can be used by the programmer to draw lines.
A programmer writes the code to draw a square. The code is shown below.
Write the code that would draw a hexagon. (3)
In the game section of the website, players are shown a board with pairs of picture tiles placed randomly.
These are then flipped over to hide the images. Players have to flip two tiles trying to find two matching images until all pairs have been found.
Identify a situation in the game where Ally will need to implement the following programming constructs. (2)
Selection:
Repetition:
The pseudocode is edited to ensure that the new weight being entered is acceptable.
(i) State the type of loop shown above. (1)
(ii) State an input the user could enter to enable the program to continue from line 18. (1)
An athlete is developing a mobile application (app).
The athletes will allow athletes to track weight in Kg.
Part of the pseudocode for the app is shown below.
(i) Identify the line that contains a condition. (1)
(ii) Identify the line that stores a value in an array. (1)
(iii) Identify the line that accepts input values into the program. (1)
Jack has been asked to write a program to calculate the potential profit in a soft drinks business. The program will store the costs involved in producing and selling one litre of each drink.
The following calculations will be used to output the profit made for each litre of drink.
Manufacturing Cost = Water Cost + Flavouring Cost + Labour Cost
Profit = Selling Cost – Manufacturing Cost
Using pseudocode or a programming language of your choice, write a program to enter the required data, then calculate and display the profit for the soft drink business. (5)
Glow Blogs uses cookies to enhance your experience on our service. By using this service or closing this message you consent to our use of those cookies. Please read our Cookie Policy.