PRLD5121 Ta
PRLD5121 Ta
SIGN
I have read the assessment rules provided in this declaration.
This assessment is my own work.
I have not copied any other student’s work in this assessment.
I have not downloaded my assessment response from a website.
I have not used any AI tool without reviewing, re-writing, and re-working this
information, and referencing any AI tools in my work.
I have not shared this assessment with any other student.
(LU2)
• (LO2) Include relational operators in a selection structure
• (LO3) Include the logical operators AND, OR, and NOT in a selection structure
• (LO4) Apply the precedence rules for logical operators in combined logical or Boolean
expressions
• (LO5) Create complex selection structures
• (LO7) Write pseudocode using counted loops and conditional loops
• (LO8) Include nested loops in your programming solution.
(LU3)
• (LO1) Explain an array data structure
• (LO2) Access the elements in an array
• (LO3) Write pseudocode that searches for a specific value in an array
• (LO4) Discuss parallel arrays
• (LO5) Explain why data should be sorted
• (LO6) Write pseudocode to sort an array using a Bubble Sort
Q.1.1 Explain with an example the difference between a variable and a constant. (4)
Q.1.2 Snake casing is one of the variable naming conventions. Explain snake casing and (4)
give an example.
Q.1.3 Draw a flowchart that will determine the volume of a cylinder. (7)
Input the values of h (height) and r (radius). Calculate the volume (v) using the
formula given below and display the volume. PI is a constant and is equal to 3.14.
v=pi*r*r*h
Q.1.4 Draw a hierarchy chart and indicate the following modules as forming part of the (5)
application to be developed:
• login()
• calculateVolume()
• calculateSurfaceArea()
Q.2.1 Write the pseudocode to calculate the sum of the numbers 1 to 10. Make use of a (10)
while loop. Comment on your code.
Q.2.2 Write the “if “statement in a pseudocode snippet. Determine if “a” is less than “b” (5)
or “a” is less than “c”. If “a” is less than either “b” or “c” then display the message
“Yes, it is the correct value” otherwise display the message “You entered the
wrong value”.
Q.3.1 Declare an array called MONTH. Initialise the array by assigning the values below: (3)
January, February, March, April, May, June, July, August, September, October,
November, December.
Q.3.2 Identify the sorting technique and then explain the logic in the pseudocode (10)
snippet.
Q.3.3 Write pseudocode to search for an item price using parallel arrays. (12)
The first array ITEMS, should be populated with values “Pencil”, “Rubber”, and
“Paintbrush” and the second array PRICES, should be populated with values 3, 5
and 10.
The user must be prompted to enter an item to search for: e.g., Paintbrush and
then display its price. Include comments.
END OF PAPER