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
alexira [117]
3 years ago
14

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. Write a code segment that prints "attending" if rsvp is true and prints "not attending" otherwise. Write the code segment below.
Computers and Technology
1 answer:
Maru [420]3 years ago
6 0

Answer:

int main()

{

   bool rsvp;

   string option1,option2="Not attending";

   int selection;

   cin>>rsvp;    //rsvp value to be entered by user

   if(rsvp=true)     //to check if rsvp is true

   {

       cin>>selection;     //only if rsvp is true then selection's value would matter

       switch(selection)             //to appoint right value to option1

       {

           case 1 : option1="Attending you will be served beef";

           exit;

           case 2 : option1="Attending you will be served chicken";

           exit;

           case 3 : option1="Attending you will be served pasta";

           exit;

           default : option1="Attending you will be served fish";   //any other integer will have value fish

           exit;

       }

       cout<<option1;

   }

   else

       cout<<option2;      //if false then option2 will be printed

   return 0;

}

Input :

true

2

Output :

Attending you will be served chicken

Explanation:

The question is incomplete as it has missed other 2 code segments which states that option1 and option2 are printed strings which tells attending or not attending. Also, selection is the integer value for the food to be served if attending or rsvp is true.

In the above code, first rsvp value is taken from the user and checked if true or false. If rsvp is true then selection is read from user as otherwise its value won't matter. Then option1 string is initiated according to the va.lue given and printed to the user. If rsvp is false then direct option2 string is outputted which is "not attending".

You might be interested in
Clickable text or images that take you to different sites on the World Wide Web are called __________.
andrew-mc [135]

they are called links my dear watson

6 0
3 years ago
Read 2 more answers
Technology is defined as human ________________ in action that involves the generation of knowledge and processes to develop sys
Alenkasestr [34]

Answer:

Innovation:

Explanation:

Technology is defined as human innovation in action that involves the generation of knowledge and processes to develop systems that solve problems and extend human capabilities.

To innovate is to make changes in something established, especially by introducing new methods, ideas, or products.

5 0
2 years ago
An end-user device requires a specific IP address every time it connects to the corporate network. However, corporate policy doe
sesenic [268]

Answer:

DHCP reservation  is the correct answer.

Explanation:

It is the Internet Protocol assignment which is not temporary. It is the particular address of the Internet Protocol within a DHCP set, which is not temporarily assigned to a particular DHCP client for lease use.

So, the device of the last user required the address of the Internet Protocol whenever they linked to the company's server. The following reservation provides the permission to use static addresses of the Internet Protocol without affecting the company's server.

6 0
3 years ago
You work part-time at a computer repair store. You're building a new computer. The customer has requested two serial ATA (SATA)
Svetllana [295]

You should design and develop the computer system with two serial ATA (SATA) hard drives installed on it.

<h3>What is a computer?</h3>

A computer can be defined as an electronic device that is designed and developed to receive data in its raw form as an input and it processes these data into an output (information), which can be used to perform a specific task through the use of the following computer parts:

  • Keyboard
  • Network
  • Monitor screen
  • Mouse
  • Hard drive

<h3>What is a hard drive?</h3>

A hard drive can be defined as an electro-mechanical, non-volatile data storage device that is made up of magnetic disks (platters) that rotates at high speed.

Based on the information provided, we can logically deduce that you're required to design and developed a computer with two serial ATA (SATA) hard drives.

In conclusion, you should follow the aforementioned steps to develop this computer with two serial ATA (SATA) hard drives installed on it.

Read more on hard drive here: brainly.com/question/26382243

#SPJ1

5 0
2 years ago
Fill in the blank to make the following true.<br> 2 ** 3 =
avanturin [10]

Answer:

2 ** 3 = 8

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Changeover means that ____. (select all that apply)
    7·2 answers
  • Face book requires you to change your password regularly<br> a. TRUE<br> b. FALSE
    14·1 answer
  • Write an algorithm that receives 500 numbers from the user and prints out the maximum of the numbers.
    9·1 answer
  • C++ what is wrong with my equation?
    10·1 answer
  • . What is the relationship between frequency, wavelength and speed of a wave?
    15·1 answer
  • Which is better PS4 or Xbox 1?
    13·2 answers
  • what is hardware ? Name the four functional hardware of a computer system Define each of them with the help of a diagram​
    12·1 answer
  • A class can inherit behavior from a parent but also define its own and override parent behavior. This is called:
    8·1 answer
  • Assslainsdffddsvvdesdssbhasasco5m
    5·2 answers
  • Public class Dog
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!