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
All of the following are simple steps for optimizing web page content except:
dangina [55]

Answer:

The correct answer is letter "B": segmenting computer servers to perform dedicated functions.

Explanation:

Computer segmentation refers to separating a server from the rest of the computers within the same network. The segmentation can separate one computer from others or groups of servers from one another. Thew type of segmentation will always depend on the device used to do the separation of the servers.

3 0
3 years ago
Write a program that could find whether the number entered through keyboard is odd or even the program should keep on taking the
natulia [17]

Answer:

using namespace std;

int main() {

int number;

while (1) {

 cout << "Enter a number: ";

 cin >> number;

 cout << number << " is " << ((number % 2) ? "odd" : "even") << endl;

};

return 0;

}

Explanation:

This is a c++ version. Let me know if you need other languages.

The (number % 2) is the essence of the program. It returns 0 for even numbers, and 1 for odd numbers (the remainder after division by 2).

7 0
4 years ago
When using overloaded functions in appication code, the compiler will call which one
musickatia [10]

Answer:

The function with same name,same number and type of arguments.

Explanation:

Function overloading occurs when the functions with same name in the same scope with the same return type but different argument numbers and different argument types.So when we want to call a specific function we have to pass the same number of arguments with same type of arguments.We can do function overloading for the functions with same return type only.

7 0
4 years ago
What is the relationship between interrupt and buffer <br>​
Jlenok [28]

Answer:

Operating systems have some code called an 'interrupt handler', which prioritises the interrupts and saves them in a queue. Buffers are used in computers as a temporary memory area, and they are essential in modern computers because hardware devices operate at much slower speeds than the processor.

8 0
2 years ago
Which sequence best describes the evolution of computers?
SVETLANKA909090 [29]

Answer:

d. Mainframes came before minicomputers, which led to the development of microcomputers.

Explanation:

The first <em>mainframe</em> was introduced in 1951: The UNIVAC (UNIVersal Automatic Computer I): large computer systems, for general purpose, with hundreds of users (separated from the computer) and fast computations, typically deployed by large business, industry, and government organizations.

The <em>minicomputers</em> are another class of computers that start to evolve since the late of the 1950s and the beginning of 1960s (like LINC, PDP-1, among many others), and focused on to have a more direct contact with the user or programmer, and because of this, it is said that minicomputers were the first 'personal' computers. They were cheaper than mainframes and with less memory capacity.

Finally, the <em>microcomputers</em> appeared around the beginning of 1970s (Micral), and sometime later (Altair 8800,  Apple II) and were firstly used by hobbyists and computers enthusiasts. The term microcomputers have been supplanted nowadays by 'personal computers'.

 

7 0
3 years ago
Other questions:
  • The Circular Flow Model includes serveral actors. Which of the following is NOT listed in the Circular Flow Model?
    12·1 answer
  • Online banking tools allow you to pay bills from your computer. <br> a. True<br> b. False
    5·2 answers
  • A phonebook typically lists the name, address, and telephone number of everyone living in an area. Write code defining a structu
    15·1 answer
  • Help me with Java Coding, I don't know what I am doing wrong in driver class. Please fix in Java and upload.
    14·1 answer
  • What is network and also how many types of network are there as well
    6·2 answers
  • Which is the fastest CPU and why?
    5·1 answer
  • How many characters should a strong password have? four six eight ten
    10·2 answers
  • Place the steps in order for manually creating a New Contact Group
    10·2 answers
  • List and explain three computing devices from the 20th century​
    13·2 answers
  • Computer engineering is a career that......
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!