subject
Computers and Technology, 03.11.2020 01:00 ayrias

Assume that the following variables have been properly declared and initialized. a boolean variable named rsvp
an int variable named selection, where 1 represents "beef", 2 represents "chicken", 3 represents "pasta", and all other values represent "fish"
a String variable named option1
a String variable named option2
(c) Write a code segment that will store a dinner selection in option1 based on the values of rsvp and selection. The intended behavior of the code segment is described below.

If rsvp is true, the code segment should store in option1 a string indicating the person’s attendance and food choice. For example, if rsvp is true and selection is 1, the following string should be stored in option1.

"Thanks for attending. You will be served beef."

If rsvp is false, the following string should be stored in option1, regardless of the value of selection.

"Sorry you can't make it."

Write the code segment below. Your code segment should meet all specifications and conform to the examples.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
Which process would best represent the opposite of exhausting air from a system?
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
question
Computers and Technology, 24.06.2019 15:50
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
You know the right answer?
Assume that the following variables have been properly declared and initialized. a boolean variable...
Questions
question
Mathematics, 06.03.2020 12:32
question
Mathematics, 06.03.2020 12:32
question
Mathematics, 06.03.2020 12:32
question
Mathematics, 06.03.2020 12:32
Questions on the website: 13722361