Answer:
The code segment is written in Java.
- boolean rsvp = true;
- int selection;
- String option1;
- String option2;
-
- if(rsvp == true){
- System.out.println("attending");
- }else{
- System.out.println("not attending");
- }
Step-by-step explanation:
Declare all the variables as required by the question (Line 1 - 4).
Create a control structure using if-else statements so that when rsvp equal to true, the program will display "attending" else it will display "not attending".