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
Which line in the following program will cause a compiler error?
Viktor [21]

Answer:

The answer is "Option A".

Explanation:  

  • In the given C++ Language program on line 8 compile-time error will occur, because in the code the conditional statement is used. In if block, we check two conditions together, which is the number variable value is greater than equal to 0 and check less than equal to 100.  
  • In this condition statement, a AND operator is used that execute when both condition is true, but in the last condition, we do not define a variable name that, checks value. That's why the program will give an error on line 8.
3 0
3 years ago
Which range of values would result in 10 elements stored in an array?
Paraphin [41]

Answer:

0-9

Explanation:

count 0 as 1

len(0,1,2,3,4,5,6,7,8,9)=10

3 0
3 years ago
Computer has brought radical change in every field​
tigry1 [53]

Answer:

Yes it has brought change in every field

Explanation:

3 0
3 years ago
The SQL WHERE clause: Limits the row data that are returned. Limits the column data that are returned. ALL Limits the column and
enyata [817]

Answer: Limits the row data that are returned.

Explanation: In structured query language (SQL), The where clause is used as a filter. The filter is applied to a column and as such the filter value or criteria determines the values that are spared in the column on which the WHERE clause is applied. All rows in which the column value does not meet the WHERE clause criteria are exempted from the output. This will hence limit the number of rows which our command displays.

For instance,

FROM * SELECT table_name WHERE username = 'fichoh' ;

The command above filters the username column for username with fichoh, then displays only rows of Data with fichoh as the username. All data columns are displayed but rows of data which do not match fichoh are exempted.

3 0
3 years ago
List 2 advantages Cryptocurrency have over regular bank transactions
ratelena [41]

Answer:

low transaction fees and speedier processing

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Over time, programming languages have evolved in phases called ________.
    5·2 answers
  • Which presenter would most likely benefit from a custom slide show?
    10·2 answers
  • ______was developed as an interim management protocol with OSI as the ultimate network management protocol.
    5·1 answer
  • The term "Cloud" refers to what option(s) below? (Select all that apply)
    13·1 answer
  • What are some pros for having your phone during school hours?
    10·2 answers
  • "Save" or "save as" can be used interchangeably and have no unique features.<br> True<br> False
    12·2 answers
  • A proper divisor of a positive integer $n$ is a positive integer $d &lt; n$ such that $d$ divides $n$ evenly, or alternatively i
    8·1 answer
  • 1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
    10·1 answer
  • Jabria are you smart
    14·2 answers
  • Define the terms network, LAN, WAN, and Internet.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!