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:練習問題
その場で採点される選択問題 5 問と、解説つきの記述問題 3 問。すべて「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?
まず自分で答えを書いてから、解説と照らし合わせましょう。
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.
まず自分で答えを書いてから、解説と照らし合わせましょう。
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)
まず自分で答えを書いてから、解説と照らし合わせましょう。
※ thinkaのコンテンツはAIにより生成されているため、内容が正確でない場合があります。補助教材としてご使用いただき、公式の教材と合わせてご確認ください。
模範解答は見ました。次はあなたの答案を採点します。
このページは良い答案の形を示せますが、あなたの答案に何が足りないかは教えられません。thinka は実際の採点基準に沿って記述答案を約 15 秒で採点します。
同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。
練習を始める