THIS IS IN JAVA. A restaurant serves breakfast before 11 am, after which they serve lunch. Which expression for XXX outputs the correct string for any time? Variable time ranges from 0 to 23 (e.g., 13 means 1 pm). mealString=XXX; // Output mealString         A. (time > 11) ? "Breakfast" : "Lunch" B. (time == 11) ? "Breakfast" : "Lunch" C. (time < 11) ? "Breakfast" : "Lunch" D. (time != 11) ? "Breakfast" : "Lunch"

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

THIS IS IN JAVA.

A restaurant serves breakfast before 11 am, after which they serve lunch. Which expression for XXX outputs the correct string for any time? Variable time ranges from 0 to 23 (e.g., 13 means 1 pm).

mealString=XXX;
// Output mealString
 
 
 
 
A. (time > 11) ? "Breakfast" : "Lunch"
B. (time == 11) ? "Breakfast" : "Lunch"
C. (time < 11) ? "Breakfast" : "Lunch"
D. (time != 11) ? "Breakfast" : "Lunch"
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT