Question 13(c) 2023 · May-June · Paper 21 · 23 marks
Question 13
Part (c)
Question 13
M Mike
Part (c)
Describe one problem that could occur with this algorithm if an invalid character was input.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 9
Question 10
8 The function LENGTH(Phrase)calculates the length of a string Phrase
Part (a)
Write the pseudocode statements to:
- store the string "The beginning is the most important part" in Phrase
- calculate and output the length of the string
- output the string in upper case.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Part (b)
Write the output your pseudocode should produce.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 11
9 Consider this logic expression.
Z = (NOT A OR B) AND (B XOR C)
Part (a)
Draw a logic circuit for this logic expression.
Each logic gate must have a maximum of two inputs.
Do not simplify this logic expression.
A
C
Part (b)
Complete the truth table from the given logic expression.
Working space
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Question 12
10 A database table called TVRange shows the main features and prices of a range of televisions.
TVCode ScreenSize Satellite SmartTV SoundBar Price$ TV90SaSmSd 90 YES YES YES 9750.00 TV75SaSmSd 75 YES YES YES 8500.00 TV75SaSd 75 YES NO YES 8000.00 TV65SaSmSd 65 YES YES YES 6000.00 TV65SmSd 65 NO YES YES 5000.00 TV65SaSd 65 YES NO YES 5000.00 TV55SaSmSd 55 YES YES YES 4000.00 TV55SaSd 55 YES NO YES 3500.00 TV55SmSd 55 NO YES YES 3500.00 TV50SaSmSd 50 YES YES YES 2500.00 TV50Sa 50 YES NO NO 1750.00 TV50Sm 50 NO YES NO 1750.00 TV40Sa 40 YES NO NO 1200.00 TV40 40 NO NO NO 950.00 TV32 32 NO NO NO 650.00
Part (a)
Give the name of the field that is most suitable to be the primary key.
State the reason for this choice.
Field ..........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
Question 13
Part (b)
The database uses the data types:
- text
- character
- Boolean
- integer
- real
- date/time.
Complete the table to show the most appropriate data type for each field. Each data type must be different.
Field Data type TVCode ScreenSize SmartTV Price$
Part (c)
Complete the structured query language (SQL) query to return the television (TV) code,
screen size and price of all Smart TVs in the database table.
SELECT TVCode, ......................................................., .......................................................
....................................................... TVRange
WHERE SmartTV = .......................................................;
Question 14
11 A one-dimensional (1D) array Days[] contains the names of the days of the week. A two-dimensional (2D) array Readings[] is used to store 24 temperature readings, taken once an hour, for each of the seven days of the week. A 1D array AverageTemp[] is used to store the average temperature for each day of the week.
The position of any day’s data is the same in all three arrays. For example, if Wednesday is in index 4 of Days[], Wednesday’s temperature readings are in index 4 of Readings[] and Wednesday’s average temperature is in index 4 of AverageTemp[]
The temperature readings are in Celsius to one decimal place. Temperatures can only be from
- 20.0 °C to +50.0 °C inclusive.
Write a program that meets the following requirements:
- input and validate the hourly temperatures for one week
- calculate and store the average temperature for each day of the week
- calculate the average temperature for the whole week
- convert all the average temperatures from Celsius to Fahrenheit by using the formula
- output the average temperature in Celsius and in Fahrenheit for each day
- output the overall average temperature in Celsius and in Fahrenheit for the whole week.
Fahrenheit = Celsius * 9 / 5 + 32
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays, variables or constants; you may assume that this has already been done.
All inputs and outputs must contain suitable messages.
All data output must be rounded to one decimal place.
You will need to initialise and populate the array Days[] at the start of the program.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Question 15
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Question 16
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Why this question appears here
98% assigned-topic match · Programming › Arrays
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 0478_s23_qp_21.pdf
