Write a code segment that will store a dinner selection in option1 based on the values of rsvp and selection. The intended behavior 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.

Answers

Answer 1

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:

if (rsvp == true && selection = 1){

      option1 = "Thanks for attending. You will be served beef.";

}

else{

option1 = "Sorry you can't make it.";

}

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 option1If otherwise, "Sorry...." is saved in option1

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

Read more about similar programs at:

https://brainly.com/question/14166674


Related Questions

b. 2 and 22
function,
13. To input a decimal you need the
a. float
b. int
C. str
d.
val


Python

Answers

Answer:

i think the answer is c so yea

how many levels of heading tags are allowed in html?

Answers

Answer:

six levels

Explanation:

HTML defines six levels of headings. A heading element implies all the font changes, paragraph breaks before and after, and any white space necessary to render the heading. The heading elements are H1, H2, H3, H4, H5, and H6 with H1 being the highest (or most important) level and H6 the least.

Answer:

six levels

Explanation:

What are the advantages and disadvantages of working with APIs when developing applications?

Answers

Answer:

Disadvantage:-There is a lot of conveniences and advantages to APIs, but business leaders should also be aware of the disadvantages. As a single point of entry, an API is a gateway and can become a hacker's primary target. Once the API is compromised, all other applications and systems become vulnerable.

Nine of the top ten vulnerabilities listed in the OWASP Top 10 now mention APIs — and since APIs can be accessed over the internet, they will have all the same disadvantages as any other Internet-based resource.  APIs are vulnerable to man-in-the-middle attacks, CSRF attacks, XSS attacks, SQL injection, and DDoS attacks.

ADVANTAGE:- Automation: with APIs, computers rather than people can manage the work. Through APIs, agencies can update work flows to make them quicker and more productive

Explanation:

pLEASE MAKE ME AN BRAINLAEIST

which item is developed last in the cyclical design process

Answers

The item that is developed last in the cyclical design process is known to be Prototype.

What is the last step in the design process?

Designers which can be known to be evaluators are said to test the complete product using the best solutions known to be in the Prototype stage.

Note that The item that is developed last in the cyclical design process is known to be Prototype.

Learn more about  design process from

https://brainly.com/question/10039920

#SPJ1

1. YOU CAN REVERSE AN UNDO ACTION BY CLICKING REDO. *

True
False

Answers

Answer:

if it's on the keyboard false

Explain the working principle of computer with suitable diagram.

Answers

Based on the instructions given, a computer receives data through an input unit and sends it back through an output system after it processes the data. ... Once the data is obtained, the central processing unit (CPU) takes over and processes the information it was provided along with the aid of other components.

what is a for command? can u use a variable instead of a number in the for command!

Answers

Answer:

A for loop is a block of code where a certain instruction repeats a certain amount of times.

Yes, you can use a variable instead of a number in a for loop.

Explanation:

For example, you're using a for loop and you want to repeat it a certain amount of times, but you want to take user input. You would ask the user for their input and assign it to a variable, then use that variable for the for loop.

heyyyyyy who likes anime​

Answers

Answer:

You apparently

Explanation:

Answer:

I don't like anime I love it

Help guys thank you =) ​

Answers

1.LR
2.LR
3.HR
4.LR
5.HR

Which 2 tools are useful to remote employees and coworkers.

Answers

Two big useful tools are one, File Storage tools, and two, Project Management Tools.

what does the term attenuation mean in data communication?

Answers

Simple Answer: Loss of signal strength

Information: Attenuation is the loss of signal strength in networking cables or connections

Which of the following tabs on the Ribbon contains the command to add a Quick Part to a document? A Design B Insert C View D Home ​

Answers

The tab on the Ribbon which contains the command to add a Quick Part to a document is: B. Insert.

Microsoft office can be defined as a processing software application (program) that is designed and developed by Microsoft Inc.

Basically, Microsoft office comprises three (3) main software applications and these are:

Microsoft Word.Microsoft PowerPoint.Microsoft Excel.

The Quick access toolbar is a small, customizable toolbar that is designed to contain a set of commands, which are completely independent of the particular tab appearing on the Ribbon that is being displayed to an end user.  

Generally, the command which is designed to add a Quick Part to a document is the Insert tab on the Ribbon.

Read more: https://brainly.com/question/19847875

The command to add a Quick Part to a document is located under the Insert tabs on the Ribbon.

Ribbon:

Microsoft Office is used as the processing software application that's been created and designed by Microsoft Inc. It consists of three core software applications: Word, Excel, and PowerPoint.

Its "quick access toolbar" is still a short, customizable toolbar that includes the set of instructions. It's completely autonomous of the tab that is currently displayed on the Ribbon to the end-user.This Insert tab just on the Ribbon is usually the function that is used to add a Quick Part to a project.

Therefore, the final answer is "Option B", which is Insert.

Find out more information about the Ribbon here:

brainly.com/question/618639

How can I use HTML to express a personal value

Answers

Answer: Order list

Explanation:

We can use HTML to express a personal value as a order list of some of our personal feelings.

What is HTML?

HTML stands for Hyper Text Markup Language. It is defined as the preferred markup language for texts intended for web browser display. HTML is the name of the language that describes how Web pages are organized. HTML allows authors to publish documents with headings, text, tables, lists, graphics, etc. online. Utilizing hypertext links, you can instantly access internet content by clicking a button.

You must assess the major facets of life, including the environment, job, enjoyment, romance, personal development, money, health, friends, and family, in order to develop a strong personal value system. Consider the significance of each area of your life, and then consider how fulfilled you currently feel in each area.

Thus, we can use HTML to express a personal value as a order list of some of our personal feelings.

To learn more about HTML, refer to the link below:

https://brainly.com/question/24065854

#SPJ2

tomaso is explaining to a colleague the different types dns attacks. which dns attack would only impact a single user?

Answers

A DNS attack which would only impact a single user is: DNS poisoning attack.

DNS is an acronym for domain name system and it can be defined as a naming database in which internet domain names (website URLs) are stored and translated into their respective internet protocol (IP) address.

This ultimately implies that, a Domain Name System (DNS) is used to connect a uniform resource locator (URL) or a web address with their internet protocol (IP) address.

In Cybersecurity, there are different types of DNS attacks and these include:

‎DNS flood attack.DNS tunneling.DNS poisoning attack.

DNS poisoning attack is a special type of Domain Name System (DNS) attack that is designed to only impact or affect a single user.

Read more: https://brainly.com/question/17273205

resolution of bitmap graphics is typically measured in

Answers

Answer:

Pixels

Explanation:

The resolution of bitmap graphics is said to be measured in DPI (dots per inch).

What is the measurement  about?

The unit of measurement is often used to tell more about  the resolution of images and it is known to be called DPI (dots per inch).

Therefore, in the above case, The resolution of bitmap graphics is said to be measured in DPI (dots per inch).

Learn more about bitmap from

https://brainly.com/question/21449716

#SPJ6

An object on the computer use to store data, information and settings is known as?​

Answers

Answer:

Hard disk maybe.......

What is the first step in finding a solution to a problem?

1: Choose a solution.
2:Think of options to solve the problem.
3:Try the solution.
4:Turn the problem into a question.

Answers

Answer:

Can i have a points? Tysmm

Answer:

4: Turn the problem into a question

Explanation:

The first step in solving any problem is to properly define what exactly is the problem.

This is easier said than done simply because we can sometimes only see or notice the symptoms of a problem or the results but not the cause of those symptoms/results. The cause is the real problem which may be very elusive or just too complex to define.

So identifying the actual problem is the most important first step to solving it.

The slogan "You deserve a break today" is an example of a

Answers

Answer:

c trademark

Explanation:

What are megapixels?
A. the size of an image captured by a camera
B. giant pixels inside the camera
C. a computer store
D. a video game played in a camera

Answers

Answer:

A.

Explanation:

A. It's the total number of pixels in an image obtained by multiplying the dimensions (height times width). For large images, this multiplication can be in the millions (=mega), hence the term mega pixels.

what function do you need to call to ask the user of the program to enter text?

Answers

Answer:

raw_input() function

The function that one need to call to ask the user of the program to enter text is the readLine function. The correct option is a.

What are the functions of programming?

Code units that are "self contained" and carry out a particular purpose are called functions. Typically, functions "take in," "process," and "return" data and results. Once a function has been written, it can be utilized countless times.

It is possible to "call" functions from within other functions. These coding building pieces are known as functions in programming. There are input and output in every programming function.

The function has instructions that are used to translate its input into output. It is comparable to a cow that consumes grass (the input), converts it into milk, and then is milked by a dairy farmer (the output).

Therefore, the correct option is a. readLine.

To learn more about functions, refer to the link:

https://brainly.com/question/29760009

#SPJ5

The question is incomplete. Your most probably complete question is given below:

readLine

readln

text

println

!! please help!!

What technique is used in this code to repeat the process for each value in the array?

a. pause blocks
b. a repeat loop
c. a for loop
d. an array block​

Answers

Answer:

C: A for loop.

Explanation:

The for loop is used to repeat a section of code known number of times.

The String otherObjects() method relies on the ____________.

a) name.indexOf() method
b) name.equals() method
c) name.compareTo() method
d) name.length()

Answers

B name.equals() method

PLS HELP WITH MY PYTHON HW ILL GIVE YOU BRAINLIEST

Answers

Answer:

class Cat:

   isHungry = None

play = Cat().isHungry = True

eat = Cat().isHungry = False

if play:

   print("I am hungry, I cannot play")

else:

   play = Cat().isHungry = False

if eat:

   print("I am full, I cannot eat")

else:

   eat = Cat().isHungry = True

Explanation:

Just simple if and else statements.

When it comes to credit scores, why is having a
thin file NOT good?
What reasons might an 18-year-old have for
his/her thin file?

Answers

Answer:

credit karma

Explanation:

karma is -69

An algorithmic solution to a problem is one in which a. a learned set of rules is used in answering the problem. b. the answer is arrived at by using the availability heuristic. c. the answer is arrived at by intuition. d. general and functional techniques are used in answering the problem.

Answers

Answer:

d

Explanation:

An algorithmic solution to any given problem is one in which is known to be a  learned set of rules is used in answering the problem.

What is Algorithmic solutions?

This is  known to be the solutions to a problem that targets how to handle a problem in a number of steps.

Therefore, An algorithmic solution to any given problem is one in which is known to be a  learned set of rules is used in answering the problem.

Learn more about algorithmic solution from

https://brainly.com/question/24953880

#SPJ6

Choose the term that best completes each sentence.

Using a _______ to write code is often a better option for a visually impaired programmer, since it tends to be more accessible than one with a ________ .

answer choices:
command line interface
graphical interface

Answers

Using a graphical interface to write code is often a better option for a visually impaired programmer, since it tends to be more accessible than one with a command line interface.

What is graphical user interface?

The Graphical User Interface is known to be a very common user Interface that is made up of Graphical representation such as buttons and icons.

In this interface, communication can be carried out through the use of interacting with the icons instead of the usual text-based or command-based communication. A good example of it is the Microsoft operating systems.

Learn more about graphical interface from

https://brainly.com/question/22811693

1. The correct definition of ergonomics is: (a) The correct way to position your feet when in front of electronic equipment. (b) How to use a computer to view safety software. O (c) The creation and adjustment of products and systems, so that they are comfortable and safe for day to day use. (d) The creation of products and systems that will not be so comfortable so as to cause the user to fall asleep while using it.​

Answers

Answer:

I'd assume it's C.

Explanation:

hope this helps!

Ray owns a gaming cafe where users can play video games on computers. These games involve rich graphics and need high processing to function. What type of client does ray use for games in the gaming cafe.

Ray uses a(n) _____ client for the video games.

Answers

Answer:

thick

Explanation:

i took the test and got it right

5) Match the following.

Answers

1 .hub
2.server
3.Network Interface
4.Workstation


I’m sorry if I’m wrong :(

I hope it helps

excel creates which type of cell references in formulas by default?

Answers

Answer: relative references

Explanation: By default, all cell references are relative references. When copied across multiple cells, they change based on the relative position of rows and columns. For example, if you copy the formula =A1+B1 from row 1 to row 2, the formula will become =A2+B2.13 may. 2020

Other Questions
identify two ways lean production might be achieved HELP SOON PLEASE THIS IS DUE TONIGHT! I WILL GIVE BRAINLIEST!In an experiment where you use wires, a 9 volt battery, and a light bulb; what would be the best conductor to put on the ends of the wires? Please rate the following solution/liquids and their brightness from 1-5-Tap water-Baking soda -Vinegar -Coca Cola (or any soda, I guess) A chef will make a soup with five ingredients: one of four meats, one of four vegetables, one offour kinds of noodles, one of four kinds of broth, and one of four spices. How many differentcombinations of ingredients could the chef put into the soup?A. 20B.256C. 1,024D. 3,125 Two numbers are in the ratio 7: 4 . If they differ by 15 ,the numbers are Which of the following is NOT a correct description of cnidarian nervous tissues? what are common administration routes for naloxone Hi I really need help with this question, ANSWERS ONLY, I'll give 35 POINTS, PLEASEWhat is the positive conterminal angle to -32 that is between 500 and 1000 and a negative conterminal angle to -32 that is between -500 and -50?positive coterminal angle:negative coterminal angle: Describe three adaptive advantages of mammalian anatomy Which one is correct? Please!!!!!!!!! Brainlist After reading the articles, you will participate in a group discussion on the following topic:How can Americans today best honor the contributions of Black Americans in the Civil War?Summarize the main points in the article "54th Massachusetts Regiment." Your response should includeinformation about what made the regiment unique for its time, what it accomplished, and how it has beenmemorialized. What is something that prevents people from voting in elections? Choose the sentence in the plural form: C'est le crayons.C'est les crayons.Ce sont les crayons.Ce sont les crayon. please help MARKING BRAINLIST Write a paragraph 5-8 sentences about this image. Tell a story of what is happening. May I please receive help?Please??? help for brainliest also 30 points 82% of the 200 animals in a dog or cat rescue centers are cats. What percentage are dogs?A. 82%b. 59%C. 24.39%D. 41% Why are bacteria called the borderline between plants and animals In Luke Chapter 10, who could the laborers be that Jesus refers to?paid workers to harvest the grainmissionariesslaves to work on the farmsfollowers of Christ willing to tell others about JesusDenemies of Christ an economist would explain reeces decision to be because she the prepaid cost, and made her decision based on the marginal benefit and cost of going. in economics these prepaid costs would be referred to as costs, which are unrecoverable.