Which of the following pseudocode DECLARE statements correctly defines a variable to store a single symbol such as '%' or '?' according to the syllabus standards?
Cambridge IGCSE · Computer Science (0478)
Programming concepts:練習問題
その場で採点される選択問題 5 問と、解説つきの記述問題 5 問。すべて「Programming concepts」からの出題です。
Evaluate the result of the following pseudocode expression using the library routine ROUND:
Value ← ROUND(7.625 * 2, 1)
Determine the final value of Total after the following nested loops are executed:
Total ← 0
FOR Outer ← 1 TO 3
FOR Inner ← Outer TO 3
Total ← Total + 1
NEXT Inner
NEXT Outer
Identify the most appropriate basic data type for a variable that stores whether a system alarm is currently 'ON' or 'OFF'.
Evaluate the result of the following pseudocode string handling operations:
Title ← "IGCSE2026"
Result ← SUBSTRING(UCASE(Title), 1, 5)
Identify the most appropriate basic data type for a variable that stores the number of items currently in a shopping basket (e.g., \( 12 \)).
まず自分で答えを書いてから、解説と照らし合わせましょう。
A variable X has an initial value of \( 10 \). State the final value of Y after the following pseudocode is executed:
IF X > 5 THEN
IF X < 15 THEN
Y ← 20
ELSE
Y ← 30
ENDIF
ENDIF
まず自分で答えを書いてから、解説と照らし合わせましょう。
Identify the resulting value and the final data type of the variable LogicFlag in the following statement:
LogicFlag ← (25 DIV 4) < (15 MOD 6)
まず自分で答えを書いてから、解説と照らし合わせましょう。
A programmer is developing a software module to manage a sequence of temperatures. The system needs to process these values to identify trends and ensure data integrity.
(a) Write pseudocode for a function named FindThresholdCount. The function should:
- Accept two parameters: an ARRAY of 50 REAL numbers named TempData and a REAL value named Threshold.
- Iterate through the array and count how many temperatures are strictly greater than the threshold.
- Return the total count.
(b) The system needs to validate user input for a temperature reading. Write pseudocode for a procedure named GetValidTemp that:
- Repeatedly prompts the user to enter a temperature.
- Uses a post-condition loop to ensure the temperature is between \(-50.0\) and \(150.0\) inclusive.
- Stores the valid input in a global variable named CurrentTemp.
(c) Explain the difference between a function and a procedure in terms of how they provide results back to the calling part of the program.
まず自分で答えを書いてから、解説と照らし合わせましょう。
A software developer is creating a routine to validate user inputs during the registration process.
(a) Define a FUNCTION called CheckLength that receives a string InputString and an integer MinLength as parameters. The function should return TRUE if the string length is greater than or equal to the minimum length, and FALSE otherwise.
(b) Write pseudocode to call this function within a REPEAT ... UNTIL loop that keeps asking the user for a password until it meets a minimum requirement of \(8\) characters.
まず自分で答えを書いてから、解説と照らし合わせましょう。
※ thinkaのコンテンツはAIにより生成されているため、内容が正確でない場合があります。補助教材としてご使用いただき、公式の教材と合わせてご確認ください。
模範解答は見ました。次はあなたの答案を採点します。
このページは良い答案の形を示せますが、あなたの答案に何が足りないかは教えられません。thinka は実際の採点基準に沿って記述答案を約 15 秒で採点します。
同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。
練習を始める