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生成,可能並非總是準確或最新。請將其用作輔助資源,並與官方材料進行核實。
想多做幾條同類題目?立即開始練習呢個課題,即做即批改。
立即練習