In a program, a programmer declares a variable `temperature` to store the current temperature reading. Which of the following would be an appropriate assignment statement to store a value of 25.5 degrees Celsius into this variable, using common pseudocode syntax?
Senior Secondary (HKDSE) · Information and Communication Technology
Program Development: Practice Questions
5 multiple-choice questions marked as you go, and 3 written questions with worked solutions. All on Program Development.
A programmer is developing a program to manage a list of 40 students' marks. Which data structure is most suitable for storing these marks together under a single identifier?
A logic expression is evaluated as follows: result = (NOT A OR B) AND C.
If A = True, B = True, and C = False, what is the value of result?
In the context of Program Development, what is the main purpose of using comments and indentation in source code?
Consider the following pseudocode involving an array List:List = [2, 3, 5, 2]
FOR i FROM 1 TO 3 DO
List[i] = List[i] * List[i-1]
END FOR
What is the final content of List after the loop finishes?
In program development, when a value is assigned to a variable that remains unchanged throughout the execution of the program, what is this identifier technically called?
Write your answer out first, then check it against the worked solution.
A programmer is writing a script to process student grades. If the program uses an expression like final_score = (test1 + test2) / 2, identify the assignment statement and name the arithmetic operator used for division.
Write your answer out first, then check it against the worked solution.
A smart city sensor records hourly noise levels (in dB) for a 10-hour period and stores them in a one-dimensional array NOISE_LEVELS. An 'unhealthy period' is defined as a sequence of consecutive hours where the noise level is strictly greater than \( 85 \) dB. You are tasked with designing an algorithm to find the duration of the longest continuous unhealthy period within that 10-hour window.
(a) Identify the input and output for this algorithm. (2 points)
(b) Using pseudocode, develop an algorithm to determine the duration of the longest continuous unhealthy period. Use the variables max_duration and current_count in your logic. (3 points)
(c) Perform a dry run for your algorithm using the following data: NOISE_LEVELS = [70, 90, 88, 92, 80, 87, 89, 95, 91, 75]. Show the final value of max_duration and the intermediate values of current_count. (2 points)
(d) State one boundary case that should be tested to ensure the logic correctly handles edge scenarios for this program. (1 point)
Write your answer out first, then check it against the worked solution.
* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.
You've seen the model answer. Now get yours marked.
This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.
Want more questions like these? Get a fresh set on this topic, graded as you go.
Practice More