Câu 121: FC0-U61: CompTIA IT Fundamentals
A developer is troubleshooting code in an application. The code is supposed to return the word `vegetables` if the category id is only 2. However, the code is returning vegetables for all values except category id 1. Which of the following code statements would BEST correct the issue?
Nội dung câu hỏi
A developer is troubleshooting code in an application. The code is supposed to return the word `vegetables` if the category id is only 2. However, the code is returning vegetables for all values except category id 1. Which of the following code statements would BEST correct the issue?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. If category id = 1 then 'Fruit' Else 'Vegetables'
- B. If category id = 1 then 'Fruit' Else if category id = 2 then 'Vegetables' Else 'Candy' — đáp án hiện tại
- C. If category id <> 1 then 'Vegetables' Else 'Fruit'
- D. If category id = 1 then 'Fruit' Else if category id >= 2 then 'Vegetables' Else 'Candy'
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.
Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.