105k views
4 votes
A museum charges different prices based on the day of the week and age of the visitor. The pricing rules are shown below. On Tuesday and Thursday children 10 and under get in free ($ 0). For all other days and ages the cost is ten dollars ($ 10). The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is stored in the variable price. Which piece of code will correctly decide the price for each ticket. A. B. C. D.

2 Answers

4 votes

Answer:

D because we want the code to say day is equal to tuesday or day is equal to thursday and age is less than or equal to 10

Step-by-step explanation:

User Gustavo Carreno
by
6.5k points
2 votes

Answer:

C.

Step-by-step explanation:

You need an && statement because it says both Tuesday AND Thursday not Tuesday OR Thursday which is what the rest of the answer choices say.

User Naoufal
by
5.3k points