Senior Secondary (HKDSE) · Information and Communication Technology

Applications of Programming in Real Life : แบบฝึกหัด

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

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

A student is writing a program to control a smart fan. The program is designed to start the motor automatically when the ambient light sensor detects that a lamp in the room has been turned on. In the context of event-driven programming, what is the most appropriate term for the specific block of code that contains the instructions to start the motor?

ข้อ 2
1 คะแนน

In an event-driven program for a robotic arm, the system needs to respond to various inputs. Which of the following scenarios describes a sensor-based event rather than a user-action event?

ข้อ 3
1 คะแนน

When constructing a program that uses speech recognition to control a motor, why is it often necessary to implement asynchronous event handling rather than simple sequential polling of the audio input?

ข้อ 4
1 คะแนน

When developing a program to interact with specialized physical hardware such as an accelerometer or a speech recognition module, what is the primary advantage of using extended programming modules or libraries?

ข้อ 5
1 คะแนน

A student is developing a program for an automated greenhouse. The program must monitor the ambient brightness and trigger a motor to close the blinds when the light level exceeds a specific value. Which component of event-driven programming is primarily responsible for executing the code to close the blinds when this light threshold is reached?

ข้อ 6
3 คะแนน

A student is developing an event-driven program for an automatic street lighting system. Describe the event that would trigger the system to turn the lights on and name one physical output device that the program would control.

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

ข้อ 7
5 คะแนน

A high-tech fitness watch uses a built-in accelerometer and a vibration motor to assist users in maintaining a proper running pace. Describe the logical flow of an event-driven program for this device that triggers a tactile alert when the user's sudden acceleration exceeds a pre-defined threshold, and specify which component acts as the event source.

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

ข้อ 8
3 คะแนน

Consider a smart doorbell system designed to take a photo when motion is detected. Explain how an event handler would be structured to manage this functionality, identifying the specific event and the corresponding action.

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

ข้อ 9
8 คะแนน

A logistics company is developing an automated parcel sorting system that uses a robotic arm controlled by a microcontroller. The system includes a weight sensor, an accelerometer to detect if the platform is unstable, and servo motors to move parcels into different bins.


(a) Explain the difference between using a polling method and an event-driven method to monitor the accelerometer for instability. State one advantage of the event-driven approach in this real-life application.


(b) The developers use an extended programming library to control the motors. Describe two benefits of using such a library instead of writing low-level code to communicate with the hardware.


(c) The sorting logic is defined as follows:
- If the accelerometer detects a tilt where the vertical acceleration falls below a threshold, i.e., \( a_z < 9.0 \) \( m/s^2 \), the system must immediately call a function EmergencyStop().
- Otherwise, it reads the weight \( W \). If \( W \ge 5 \) kg, it triggers MoveArm(Bin_A). If \( 0.5 \le W < 5 \) kg, it triggers MoveArm(Bin_B). If \( W < 0.5 \) kg, the parcel is ignored.
Write a pseudocode segment for the event handler onWeightChange(W, az) that implements this logic.

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

ข้อ 10
7 คะแนน

A logistics warehouse uses a fleet of automated guided vehicles (AGVs) to transport goods. Each AGV is equipped with an accelerometer and a motor controller. The AGV program must automatically stop the motor if the vehicle detects a sudden impact or tilt beyond a safe threshold to prevent damage.


(a) Explain how the accelerometer acts as an input device for this real-life application and describe the specific type of data it would capture for the program.


(b) In the context of event-driven programming, identify the 'event' that would trigger the emergency stop and explain how an event handler would be used to manage this situation.


(c) The development team decides to use an extended programming module to interface with the AGV's hardware. State two advantages of using such a module instead of writing the hardware-level communication code from scratch.


(d) Suggest another physical device that could be integrated into the system using a similar programming approach to help the AGV avoid obstacles, and name the corresponding physical output action the program should perform when an obstacle is detected.

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

* เนื้อหาของ thinka สร้างโดย AI อาจไม่ถูกต้องสมบูรณ์ในทุกกรณี กรุณาใช้เป็นสื่อเสริมและตรวจสอบกับเอกสารอ้างอิงอย่างเป็นทางการ

คุณเห็นเฉลยแล้ว ทีนี้มาตรวจคำตอบของคุณบ้าง

หน้านี้บอกได้ว่าคำตอบที่ดีเป็นอย่างไร แต่บอกไม่ได้ว่าคำตอบของคุณขาดอะไร thinka ตรวจข้อเขียนของคุณตามเกณฑ์ให้คะแนนจริงในราว 15 วินาที

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

เริ่มฝึกเลย