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
kupik [55]
3 years ago
15

Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followe

d by a newline) if the value of userItem does not match any of the defined options. For example, if userItem = GR_APPLES, output should be:FruitSample program:#include using namespace std;int main() { enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER}; GroceryItem userItem = GR_APPLES; return 0;}Below, do not type an entire program. Only type the portion indicated by the above instructions (and if a sample program is shown above, only type the portion.)

Computers and Technology
1 answer:
vagabundo [1.1K]3 years ago
7 0

Answer:

I am writing a C++ program. Let me know if you want the program in some other programming language. Here is the portion of the code:

if((userItem == GR_APPLES) || (userItem == GR_BANANAS)){

 cout << "Fruit";   }

else if((userItem == GR_JUICE) || (userItem == GR_WATER)){

 cout << "Drink";  }

else{

 cout << "Unknown";  }  

cout << endl;

 

Explanation:

The IF statement is used to check the defined options with the value in the userItem.

If the value of the userItem is GR_APPLES OR GR_BANANAS then Fruit is printed as the output. || represents a logical operator OR so this means that userItem can be either the GR_APPLES or GR_BANANAS for the If condition to evaluate to true.

If the above condition evaluates to false then the else-if part will be checked next. So the else if checks if the value in the userItem is GR_JUICE or GR_WATER. If userItem contains either of these two then Drink is displayed on the screen as output.

If the else-if statement also evaluates to false then the else part is executed which displays Unknown.

The cout<< endl; statement in the last is used to print the new line. For example if the output is Unknown then it is followed by a new line.

In the given program userItem is set to GR_APPLES

GroceryItem userItem = GR_APPLES

So the output of the whole program is Fruit followed by a new line.

The screenshot of the code along with the output is attached.

You might be interested in
. the web is based on the ________ protocol
elena55 [62]
The standard (and default) port for HTTP<span> servers to listen on is 80, though they can use any port. </span>HTTP<span> is based on the </span>TCP/IP protocols<span>, and is used commonly on the Internet for transmitting web-pages from servers to browsers.</span>
3 0
3 years ago
What is the purpose of OPPA? A. It regulates the strength of passwords chosen by the users. B. It prohibits the use of informati
Anna35 [415]

The purpose of OPPA is to make its mandatory for companies to disclose what kind of information they will acquire from their users.

D. It makes it mandatory for companies to disclose what kind of information they will acquire from their users.

<u>Explanation:</u>

OPPA is a Online Privacy Protection Act. It gathers data from individuals who use or visit your site and use it to execute business with them. A few organizations use client data for their very own inner showcasing purposes, for example, to figure out what sort of items or administrations to offer whenever the client utilizes the site or to create focused on arrangements of clients who have similar likes or aversions.

It makes it obligatory for organizations to reveal what sort of data they will secure from their clients. It likewise incorporates data, for example, name, road address, email address, phone number, date of birth, Social Security number, or different insights concerning an individual that could enable a customer to be reached physically or on the web.

6 0
3 years ago
Which disclosure paradigm has as its assumptions that 1) an attacker will learn little or nothing from disclosure; 2) Disclosure
nekit [7.7K]

The  disclosure paradigm has as its assumptions that an attacker will learn little or nothing from disclosure is known as Open source.

<h3>What is open source?</h3>

An  Open source is known to be a term that connote that is said to be an Open source software set up to be publicly used by people.

Therefore, The  disclosure paradigm has as its assumptions that an attacker will learn little or nothing from disclosure is known as Open source.

Learn more about Open source from

brainly.com/question/6065176

#SPJ1

3 0
2 years ago
Which retouching action is unethical?
e-lub [12.9K]

Answer:

B.) removing the saturation in a photograph intended as a magazine cover page

7 0
2 years ago
Jen's house contains the following devices:
poizon [28]

Answer:

Jen's laptop and her daughter's phone, because they are both connected to the router and turned on.

Explanation:

A network comprises of two or more interconnected devices such as computers, routers, switches, smartphones, tablets, etc. These interconnected devices avail users the ability to communicate and share documents with one another over the network.

Additionally, in order for a network to exist or be established, the devices must be turned (powered) on and interconnected either wirelessly or through a cable (wired) connection.

Hence, the computers which are currently networked are Jen's laptop and her daughter's phone, because they are both connected to the router and turned on. A smartphone is considered to be a computer because it receives data as an input and processes the input data into an output (information) that is useful to the end user.

6 0
2 years ago
Other questions:
  • Your network administrator finds a virus in the network software. Fortunately,
    13·1 answer
  • Which of the following is NOT something you can specify in the bullets and numbering dialog box?
    8·1 answer
  • You can avoid culture shock by ____________.
    10·2 answers
  • Most network behavior analysis system sensors can be deployed in __________ mode only, using the same connection methods as netw
    8·1 answer
  • A subroutine may be used to refer to which of the following? Check all that apply.
    15·2 answers
  • Unleashes the ability of each person on their team to improve performance, solve problems, and
    6·2 answers
  • .Write a MATLAB script that VECTORIZES (eliminates the loop) the following code. (4points)
    14·1 answer
  • Which of the following activities does an effective team do?
    15·2 answers
  • Which engineer may design a GPS for a vehicle?
    15·1 answer
  • What do earthquakes and tsunamis have in common?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!