คำแทนคำว่า If (เช่น Unless, Provided That, As Long As, In Case)

คำแทนคำว่า If (เช่น Unless, Provided That, As Long As, In Case) — Exercise 5

/ 10

คำแทนคำว่า If (เช่น Unless, Provided That, As Long As, In Case) — Exercise 5

Practice English grammar topic คำแทนคำว่า If (เช่น Unless, Provided That, As Long As, In Case) with 10 multiple-choice questions. Answer at least 70% correctly to complete the test.

คำเชื่อมเงื่อนไขอื่นๆ ได้แก่ unless (ถ้าไม่), provided that, as long as (ในกรณีที่เท่านั้น), in case (เพื่อเป็นการป้องกัน)

B2 · ระดับกลางตอนสูง (Upper Intermediate) TOEIC 605–780 IELTS 5.5–6.5 อนุประโยคและประโยคเงื่อนไข (Clauses & Conditionals)
10 questions คะแนนผ่าน: 70% Test 5

How to take the test

  • Read each question carefully and select the best answer.
  • The test is not timed — you can complete it at your own pace.
  • Click ส่งแบบทดสอบ when finished to see your score and detailed explanations.

เข้าสู่ระบบเพื่อบันทึกผล

คุณสามารถทำแบบทดสอบได้โดยไม่ต้องเข้าสู่ระบบ แต่จะไม่มีการบันทึกผล เข้าสู่ระบบ เพื่อติดตามความก้าวหน้าของคุณ

  1. 1

    You are refactoring a system where a complex `if-else if` structure is used to determine the behavior of an object based on its components (e.g., a `Graphic` object can be a `Circle`, `Square`, or a `Group` of graphics). Which design pattern would allow you to treat individual objects and compositions of objects uniformly, thus avoiding conditional logic for handling different types?

  2. 2

    You are building a system that needs to map UI component names to their corresponding React/Vue/Angular components (e.g., 'Button' to `<ButtonComponent>`, 'Input' to `<InputComponent>`). Which data structure is most efficient for replacing a large `if-else if` or `switch` statement for dynamic component rendering?

  3. 3

    When refactoring a series of `if-else if` statements that check for different types of objects and perform type-specific actions, which design principle or pattern is often a superior alternative?

  4. 4

    Consider a scenario where you need to access a property of an object, but the object itself or an intermediate property might be null or undefined. Which operator provides a safe way to access nested properties without explicit null checks?

  5. 5

    What is the value of `discount` in `const discount = (isPremium) ? 0.15 : 0.05;` if `isPremium` is `true`?

  6. 6

    In many languages, what is the primary keyword used to define a block of code that executes based on the value of an expression in a switch statement?

  7. 7

    A payment processing system needs to support various payment methods (e.g., Credit Card, PayPal, Bank Transfer). Each method has a distinct set of steps for authorization and capture. Which design pattern would best allow you to add new payment methods without modifying the core payment processing logic, replacing a large `if-else if` structure?

  8. 8

    Which of the following is a valid way to use a `switch` statement with an `enum` type?

  9. 9

    In a `switch` statement, if a `case` block does not have a `break` statement, what happens?

  10. 10

    If `user.isAdmin` is false, what is the outcome of `user.isAdmin && showAdminPanel();`?

← กลับไปหัวข้อ