Cambridge IGCSE · Computer Science (0478)

Programming concepts: แบบฝึกหัด

ข้อปรนัย 5 ข้อ ตรวจให้ทันทีที่ตอบ และข้อเขียน 5 ข้อ พร้อมวิธีทำละเอียด ทั้งหมดจากเรื่อง Programming concepts

10 ข้อ29 คะแนนฟรี ไม่ต้องสมัคร
ข้อ 1
1 คะแนน

Which of the following pseudocode DECLARE statements correctly defines a variable to store a single symbol such as '%' or '?' according to the syllabus standards?

ข้อ 2
1 คะแนน

Evaluate the result of the following pseudocode expression using the library routine ROUND:

Value ← ROUND(7.625 * 2, 1)

ข้อ 3
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

ข้อ 4
1 คะแนน

Identify the most appropriate basic data type for a variable that stores whether a system alarm is currently 'ON' or 'OFF'.

ข้อ 5
1 คะแนน

Evaluate the result of the following pseudocode string handling operations:

Title ← "IGCSE2026"
Result ← SUBSTRING(UCASE(Title), 1, 5)

ข้อ 6
2 คะแนน

Identify the most appropriate basic data type for a variable that stores the number of items currently in a shopping basket (e.g., \( 12 \)).

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 7
4 คะแนน

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

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 8
5 คะแนน

Identify the resulting value and the final data type of the variable LogicFlag in the following statement:
LogicFlag ← (25 DIV 4) < (15 MOD 6)

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 9
8 คะแนน

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.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 10
5 คะแนน

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 วินาที

อยากฝึกโจทย์แบบนี้เพิ่มไหม เริ่มฝึกหัวข้อนี้ได้เลย ตรวจให้ทันทีทุกข้อ

เริ่มฝึกเลย