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, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
What is the first view you place in your drawing?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Research data that is presented using descriptive language is said to be
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
You know the right answer?
Assume that the following variables have been properly declared and initialized. a boolean variable...
Questions
question
Computers and Technology, 09.01.2022 17:50
question
Mathematics, 09.01.2022 18:00
question
Physics, 09.01.2022 18:00
question
Advanced Placement (AP), 09.01.2022 18:00
question
Mathematics, 09.01.2022 18:00
Questions on the website: 13722363