33.2k views
4 votes
Complete the conditional operator so ticket price is assigned with 12 if membership level is 9 or above, or with 17 otherwise. Ex: If membership level = 10, then ticket price is assigned with 12.

a) ≤
b) ≥
c) =
d) ≠

User Sayyam
by
8.0k points

1 Answer

4 votes

Final answer:

The correct conditional operator to use is 'b) ≥', meaning 'greater than or equal to.' This sets the ticket price to 12 if the membership level is 9 or higher, and to 17 otherwise.

Step-by-step explanation:

To determine the correct ticket price based on the membership level, we need to use a conditional operator. The question requires that the ticket price should be assigned the value of 12 if the membership level is 9 or above, or 17 otherwise. To implement this using the conditional operators provided, the correct operator to use is "b) ≥" which stands for 'greater than or equal to'.

Here is how the conditional statement would look in a programming context:

ticketPrice = (membershipLevel ≥ 9) ? 12 : 17;

This means if the membershipLevel is 9 or higher, the ticketPrice will be 12. If the membershipLevel is less than 9, the ticketPrice will be 17.

User Anshuman Bardhan
by
8.1k points