1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Illusion [34]
3 years ago
5

Write a code segment that will store a dinner selection in option1 based on the values of rsvp and selection. The intended behav

ior 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.
Computers and Technology
1 answer:
Serggg [28]3 years ago
5 0

The code segment illustrates the use of conditional statements.

The execution of conditional statements is dependent on the truth value of its condition.

The required code segment is as follows:

<em>if (rsvp == true && selection = 1){</em>

<em>       option1 = "Thanks for attending. You will be served beef.";</em>

<em>}</em>

<em>else{</em>

<em>option1 = "Sorry you can't make it.";</em>

<em>}</em>

<em />

The flow of the above code segment is as follows:

  • Check if rsvp is true and selection is 1; if yes, "Thanks for attending....." is saved in option1
  • If otherwise, "Sorry...." is saved in option1

The code segment submitted can be used for several programming languages such as <em>Java, C++, C and C#.</em>

Read more about similar programs at:

brainly.com/question/14166674

You might be interested in
What are some of the strategies that you use for confronting a complex problem and breaking it down into smaller pieces? How mig
bazaltina [42]

Answer:

Breaking it down I guess for me, you could take down all the possible things that you could do. Eliminating things, one by one. It could help working on a computer by not letting yourself get over-whelmed by all your programming and thinking "alright, this THEN this."

Explanation:

8 0
3 years ago
Does anyone know a way to skip the videos on Edgnuity?
Mazyrski [523]

Answer:

Yes, there is usually a skip button in the corner.

Explanation:

when i have to watch videos on there thats how i skip it

Hope this helps!!

7 0
3 years ago
Binary Number Cards
Sedaia [141]

Answer:

13: 1101

5: 0101

10: 1010

2: 0010

Explanation:

The binary system, on the other hand, is a base-2 number system. That means it only uses two numbers: 0 and 1. When you add one to one, you move the 1 one spot to the left into the twos place and put a 0 in the ones place

what is done with the dice is to have an example of how binary numbers are made until 15

5 0
3 years ago
Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
pychu [463]
Im pretty sure that is false
5 0
3 years ago
8.2: Lottery Winners A lottery ticket buyer purchases 10 tickets a week, always playing the same 10 5-digit "lucky" combinations
julia-pushkina [17]
Idk bro but pick the first one that comes to mind
3 0
3 years ago
Other questions:
  • What is a binary digit
    7·1 answer
  • Multiple client switches and routers have been set up at a small military base. The network team decided to implement Terminal A
    15·1 answer
  • Online banking tools allow you to pay bills from your computer. <br> a. True<br> b. False
    5·2 answers
  • Assume that strikeCounter has already been declared to be a "pointer to int". Assume further that strikeCounter has been initial
    5·1 answer
  • Identify the command on a local desktop CMD that will verify which group policies have been applied to the workstation. SELECT T
    12·1 answer
  • And this help me please as well. ​
    12·1 answer
  • After you have located a program name from the Start menu, in order to create a shortcut on the desktop.
    8·1 answer
  • I will give Brainliest to whoever answers correctly :3
    14·1 answer
  • Explain the working principal of computer system with suitable diagarm​
    9·1 answer
  • Differentiate between off the shelf software and bespoke software
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!