QCAA Digital Solutions Real-world problems and solution requirements
8 sample questions with marking guides and sample answers · Avg. score: 56.5%
Which data format supports structures including strings, arrays, numbers and Booleans in UTF-8 encoding?
SQL
XML
JSON
HTML
Reveal Answer
SQL
SQL is a query language designed for managing data in relational database management systems, not a data interchange format for serializing structures like arrays or objects.
XML
XML is a markup language that treats data primarily as text elements; it does not have native syntax for distinguishing numbers, booleans, or arrays without an external schema.
JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format that natively supports strings, numbers, booleans, arrays, and objects, and the standard requires UTF-8 encoding.
HTML
HTML is a markup language used for structuring and presenting content on the web, not for defining data types or serializing data structures for exchange.
An application accesses an API that obtains data relating to books read by users. The data that needs to be stored locally includes:
• one or more images of each book’s cover
• book recommendation notes
• a comment on each book.
Book data is located using the ISBN — a unique identifier for each published book. When searching for a book, the returned JSON data is outputted:
{
"volumeInfo":{
"title": "Designing Relational Databases",
"subtitle": "A beginner’s guide",
"authors": [
"Joan Janson",
"Katy Pratt"
],
"isbn": "1440569239562",
"publisher": "Books Ltd",
"publishedDate": "2016-05",
"pageCount": 367,
"imageLinks": {
"smallThumbnail": "http://books.abcd.com/books?id=jedfoYprny465&image=1&source=gbs _ api",
"thumbnail": "http://books.abcd.com/books?id=jedfoYprny465&image=3&source=gbs _ api"
}
}
}
What is the most appropriate method to store the data in local tables so it can be easily retrieved for display?
Table: book
| Field | Type |
|---|---|
| ISBN | Text |
| title | Text |
| pages | Integer |
| authors | Text |
| comments | Text |
| recommendation | Boolean |
Table: images
| Field | Type |
|---|---|
| type | Text |
| image_link | Jpg |
| ISBN | Integer |
Table: books
| Field | Type |
|---|---|
| ISBN | Text |
| title | Text |
| pages | Integer |
| comments | Text |
| recommendation | Text |
| image_link | Text |
Table: authors
| Field | Type |
|---|---|
| ISBN | Text |
| name | Text |
Table: book
| Field | Type |
|---|---|
| ISBN | Integer |
| title | Text |
| pages | Integer |
| comments | Text |
| recommendation | Boolean |
Table: images
| Field | Type |
|---|---|
| ISBN | Integer |
| image_type | Text |
| image_link | Text |
Table: authors
| Field | Type |
|---|---|
| ISBN | Integer |
| name | Text |
Table: books
| Field | Type |
|---|---|
| ISBN | Integer |
| title | Text |
| pages | Text |
| comments | Text |
| recommendation | Text |
| publisher | Text |
| published_date | Text |
Table: authors
| Field | Type |
|---|---|
| title | Text |
| name | Text |
Table: images
| Field | Type |
|---|---|
| ISBN | Integer |
| image_link | Text |
Reveal Answer
Table: book
| Field | Type |
|---|---|
| ISBN | Text |
| title | Text |
| pages | Integer |
| authors | Text |
| comments | Text |
| recommendation | Boolean |
Table: images
| Field | Type |
|---|---|
| type | Text |
| image_link | Jpg |
| ISBN | Integer |
This option violates First Normal Form (1NF) by storing multiple authors in a single Text field rather than separating them. Additionally, there is a data type mismatch between the ISBN in the book table (Text) and the images table (Integer).
Table: books
| Field | Type |
|---|---|
| ISBN | Text |
| title | Text |
| pages | Integer |
| comments | Text |
| recommendation | Text |
| image_link | Text |
Table: authors
| Field | Type |
|---|---|
| ISBN | Text |
| name | Text |
This design fails to meet the requirement of storing "one or more images" because the books table contains only a single image_link field. A separate table is required to handle the one-to-many relationship between books and images.
Table: book
| Field | Type |
|---|---|
| ISBN | Integer |
| title | Text |
| pages | Integer |
| comments | Text |
| recommendation | Boolean |
Table: images
| Field | Type |
|---|---|
| ISBN | Integer |
| image_type | Text |
| image_link | Text |
Table: authors
| Field | Type |
|---|---|
| ISBN | Integer |
| name | Text |
This is the most appropriate design because it correctly normalizes the data. It uses separate tables for authors and images to handle the one-to-many relationships (multiple authors and multiple image links per book), linking them back to the book table using the unique ISBN.
Table: books
| Field | Type |
|---|---|
| ISBN | Integer |
| title | Text |
| pages | Text |
| comments | Text |
| recommendation | Text |
| publisher | Text |
| published_date | Text |
Table: authors
| Field | Type |
|---|---|
| title | Text |
| name | Text |
Table: images
| Field | Type |
|---|---|
| ISBN | Integer |
| image_link | Text |
The authors table incorrectly uses title as a foreign key instead of the unique identifier ISBN; book titles are not unique and are poor keys. Furthermore, the pages field is defined as Text when it should be an Integer for numerical operations.
Which algorithmic statement determines the value of y between 10 and 50 inclusive?
IF 10 > y OR y > 50
IF 10 > y AND y < 50
IF y >= 10 OR y <= 50
IF y >= 10 AND y <= 50
Reveal Answer
IF 10 > y OR y > 50
This statement checks if is strictly less than 10 or strictly greater than 50, which identifies values outside the desired range rather than inside it.
IF 10 > y AND y < 50
This statement checks if is less than 10 and less than 50 simultaneously; this logic effectively only checks if and excludes values between 10 and 50.
IF y >= 10 OR y <= 50
Using the OR operator here makes the condition true for all numbers, because any value will satisfy at least one of the conditions ( or ).
IF y >= 10 AND y <= 50
This correctly uses the AND operator to ensure satisfies both boundaries simultaneously: it must be greater than or equal to 10 and less than or equal to 50.
An esports club records player details and results for playing a popular online game. The data is stored in JSON format. The club wants to display the gamer tag of each player, their age and the percentage of games won. A sample of the JSON data is shown.
{
'players': [
{
'name': 'Brandon Rioli',
'gamerTag': 'Madskills',
'dateOfBirth': '22/12/2007',
'gamesPlayed': 10,
'gamesWon': 4
},
{
'name': 'Chloe Pezer',
'gamerTag': 'PezerGirl',
'dateOfBirth': '03/04/2007',
'gamesPlayed': 58,
'gamesWon': 55
}
]
}
Use pseudocode to symbolise the algorithmic statements needed to display the required data.
Reveal Answer
BEGIN
GET currentDay
GET currentMonth
GET currentYear
SET playerArray = []
READ json file into playerArray
FOR count = 0 to playerArray.length
DISPLAY playerArray[count].gamerTag
SPLIT playerArray[count].dateOfBirth into birthday, birthMonth, birthYear
SET age to currentYear - birthYear
IF currentMonth < birthMonth THEN
age = age - 1
ELSE IF currentMonth = birthMonth THEN
IF currentDay < birthDay THEN
age = age - 1
ENDIF
ENDIF
DISPLAY age
CALCULATE percentWon = playerArray[count].gamesWon / playerArray[count].gamesPlayed * 100
DISPLAY percentWon
NEXT count
END
| Descriptor | Marks |
|---|---|
Symbolises, without logic errors, algorithmic statements for retrieving JSON data | 1 |
Symbolises, without logic errors, algorithmic statements for looping through data | 1 |
Symbolises, without logic errors, algorithmic statements for calculating age | 1 |
Symbolises, without logic errors, algorithmic statements for calculating percentage won | 1 |
Symbolises, without logic errors, algorithmic statements for displaying gamer tag | 1 |
Symbolises, without logic errors, algorithmic statements for displaying age | 1 |
Symbolises, without logic errors, algorithmic statements for displaying percentage won | 1 |
Effectively uses pseudocode conventions | 1 |
Match the correct code comment to line 2 of the pseudocode.
1 IMPORT JSON
2 SET x TO '{"name":"Ace", "age":30, "city":"Rockhampton"}'
3 SET y TO JSON.LOADS(x)
4 PRINT(x["age"])
Assign a string to variable x.
Assign a dictionary object to variable x.
Convert the text object into a dictionary object.
Convert the dictionary object into a text object.
Reveal Answer
Assign a string to variable x.
The value is enclosed in single quotes ('...'), which indicates that a string literal containing JSON-formatted text is being assigned to the variable x.
Assign a dictionary object to variable x.
Although the content resembles a dictionary, the surrounding quotes make it a string data type. It does not become a dictionary object until it is parsed in line 3.
Convert the text object into a dictionary object.
This describes the action taken in line 3 (JSON.LOADS(x)), where the string is parsed and converted into a structured object.
Convert the dictionary object into a text object.
This describes serialization (converting an object to a string), whereas line 2 is simply initializing a variable with a string literal.
A games arcade has developed a digital solution for recording members’ points. Members receive a membership card, which they scan when they play games at the arcade. The card records how many points a member receives from winning a game. A sample of the data is shown.
members
| id | given_name | last_name | phone | |
|---|---|---|---|---|
| 24 | Adalai | Akkad | adacutiepie@email.com | 0491 570 006 |
| 25 | Michael | McNealy | mikemcnealy@email.com | 0491 571 266 |
| 26 | Shruti | Flynn | shrutikins@email.com | 0491 574 118 |
| 27 | Adam | Steinberg | steintheman@email.com | 0491 577 644 |
| 28 | Julia | Wong | juliawong@email.com | 0491 579 455 |
members_activity
| id | card_number | join_date | last_visit | points_balance |
|---|---|---|---|---|
| 24 | 789987 | 2005-08-12 | 2020-01-20 | 570 |
| 25 | 456654 | 2009-02-15 | 2019-12-20 | 80 |
| 26 | 753951 | 2010-05-05 | 2020-02-25 | 249 |
| 27 | 654123 | 2019-10-19 | 2020-03-10 | 1200 |
Develop an algorithm to list all members by name. Sort the list alphabetically by last name.
Reveal Answer
BEGIN
DECLARE string memberNames = {last_name, given_name}
ORDER BY last_name
OUTPUT memberNames
END
| Descriptor | Marks |
|---|---|
solves the problem without errors | 4 |
could have solved the problem except for 1 logic error OR could have solved the problem except for syntax errors | 3 |
could have solved the problem except for 2 logic errors OR could have solved the problem except for 1 logic error and syntax errors | 2 |
could have solved the problem except for 3 logic errors OR could have solved the problem except for 2 logic errors and syntax errors | 1 |
does not satisfy any of the descriptors above. | 0 |
Develop an algorithm to list member IDs and join dates for memberships of 10 or more years. Sort the list by join date in ascending order.
Reveal Answer
Response based on C#:
BEGIN
DECLARE DateTime currentDate
DECLARE DateTime joinDate
DECLARE int memberId
DECLARE int membershipYears = currentDate - joinDate
FOR EACH int in memberId
IF membershipYears >= 10years
ORDER BY joinDate
OUTPUT joinDate, memberId
ENDIF
ENDFOR
END
| Descriptor | Marks |
|---|---|
Solves the problem without errors | 4 |
Could have solved the problem except for 1 logic error OR could have solved the problem except for syntax errors | 3 |
Could have solved the problem except for 2 logic errors OR could have solved the problem except for 1 logic error and syntax errors | 2 |
Could have solved the problem except for 3 logic errors OR could have solved the problem except for 2 logic errors and syntax errors | 1 |
Does not satisfy any of the descriptors above. | 0 |
Develop an algorithm to provide the contact details for members who currently have more than 3000 points.
Reveal Answer
BEGIN
DECLARE string memberDetails = {given_name, last_name, email}
DECLARE string memberPhone
DECLARE int pointsBalance
FOR EACH int in pointsBalance
IF pointsBalance > 3000
OUPUT memberDetails, memberPhone
ENDIF
ENDFOR
END
| Descriptor | Marks |
|---|---|
solves the problem without errors | 4 |
could have solved the problem except for 1 logic error OR could have solved the problem except for syntax errors | 3 |
could have solved the problem except for 2 logic errors OR could have solved the problem except for 1 logic error and syntax errors | 2 |
could have solved the problem except for 3 logic errors OR could have solved the problem except for 2 logic errors and syntax errors | 1 |
does not satisfy any of the descriptors above. | 0 |
An open data set contains plain text of the facilities available in Queensland parks. To develop a mobile application that identifies basketball courts in a suburb, it is necessary for data to be
retrieved, normalised and verified.
retrieved, normalised and validated.
normalised, validated and encrypted.
retrieved, modularised and validated.
Reveal Answer
retrieved, normalised and verified.
While verification involves checking data against a source, validation is the specific process required to ensure the data meets the logical rules and constraints of the application.
retrieved, normalised and validated.
The data must be obtained (retrieved), organized into a standard structure (normalised), and checked for accuracy and logical consistency (validated) to be useful for the application.
normalised, validated and encrypted.
This option omits the essential step of retrieving the data, and encryption is generally not required for public open data.
retrieved, modularised and validated.
Modularisation is a software design principle for structuring code, not a technique used for processing or cleaning data sets.
Refer to Stimulus 1 in the stimulus book.
Describe the listed algorithm constructs and identify one example of each from the stimulus. Use corresponding line numbers to identify examples.
Assignment:
Example:
Condition:
Example:
Iteration:
Example:
Reveal Answer
Assignment: A value (stated or calculated) stored in a variable/memory location.
Example: Line 13, value = 0.04.
Condition: A comparison that retrieves a true or false value (or the value of a Boolean variable).
Example: Line 12, IF depositAmount <= 10000.
Iteration: A group of algorithmic statements that are repeated while a condition is met.
Example: Lines 25–27
FOR i = 0 TO years
deposit = depositAmount + depositAmount x interestRate
NEXT i
| Descriptor | Marks |
|---|---|
Describes assignment | 1 |
Describes iteration | 1 |
Describes condition | 1 |
Identifies an example of assignment | 1 |
Identifies an example of condition | 1 |
Identifies an example of iteration | 1 |
Explain the purpose of modularisation and identify an example of how it is used in the stimulus. Use corresponding line numbers in your response.
Reveal Answer
Modularisation breaks sections of code into smaller chunks so the algorithm is easier to understand, and allows the same code to be used in different parts of the application. For example, calculateInterestRate is a separate module (lines 11–22) and is called/used at line 5. It returns a value (line 21) which is stored in interestRate (line 5).
| Descriptor | Marks |
|---|---|
Explains the purpose of modularisation | 1 |
Identifies an example of how modularisation is used | 1 |