Skip to content / Đến nội dung
ThichHocToan.com

Bebras 2022 - Level 4 Question 9

BEBRAS · Bebras 2022 - Level 4

Question 9

A shop uses computer vision to recognize customers' actions. It can tell whether a customer is looking straight ahead, lowering their head or raising their head, using the bridge-of-the-nose length called nose.
- If nose=1, the customer is looking straight ahead.

Question illustration

- When the customer nods and lowers their head, the bridge of the nose appears longer, so nose>1.

Question illustration

- When the customer raises their head, nose<1.

Question illustration

To buy n tickets, the customer nods n times, then raises their head. The controller starts when a customer stands in front of the machine looking straight ahead.

Which comparison blocks should be inserted, from top to bottom, into the following code so the program behaves as required?

Question illustration

Original program transcription:
1. Set so_ve=0.
2. Repeat until ???:
- Wait until ???.
- Wait until ???.
- Increase so_ve by 1.
3. Sell so_ve tickets.

Comparison choices: (1) nose>0; (2) nose>0.8; (3) nose>1.2; (4) nose<0.8; (5) nose<1.1.
  1. (4), (3), (5)
  2. (4), (2), (3)
  3. (5), (3), (4)
  4. (5), (2), (4)