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
sleet_krkn [62]
3 years ago
13

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 is GR_APPLES, output should be:Fruit#include int main(void) {enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER};enum GroceryItem userItem = GR_APPLES;/* Your solution goes here */return 0;}

Computers and Technology
1 answer:
Sloan [31]3 years ago
5 0

Answer:

Here is the complete code

#include <iostream>  //for input output functions

using namespace std;   //to identify objects like cin cout

int main() {  //start of main() function body

  enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER};  //enum is used to assign names to constant

  GroceryItem userItem = GR_APPLES;  

//value of userItem is set to GR_APPLES

  /* Your solution goes here  */

//if the userItem is equal to GR_APPLES or GR_BANANAS

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

 cout << "Fruit";  } //display Fruit if above if condition is true

//if the value of userItem is equal to GR_JUICE or GR_WATER

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

 cout << "Drink";  } //display Drink if the above if condition is true

else{  //if none of the above if conditions is true then print Unknown

 cout << "Unknown";  }  

cout << endl;

  return 0;  }

Explanation:

The output of the program is Fruit because the value of userItem is set to GR_APPLES and according to the if statement if the userItem is equal to GR_APPLES than "Fruit" will be displayed on the screen as output.

The program along with its output is attached as a screen shot.

You might be interested in
What does the phrase at the drop of a hat mean?
umka2103 [35]

Answer:

When you use the expression 'At the Drop of a Hat' you mean that something is happening instantly, without any delay. Example of use: “We're all packed and ready to go; we can leave at the drop of a hat.”

Explanation:

Hope this helped!!  :)

Pls thank and maybe brainliest??

5 0
3 years ago
Read 2 more answers
PLEASE HELP!!!!! (Environmental Science Semester 1)
uranmaximum [27]
I believe the answer would be B, Sorry if I'm wrong! ❤
6 0
2 years ago
Read 2 more answers
1. What is the Internet?
3241004551 [841]
A place to watch daisy Taylor vids
8 0
3 years ago
Read 2 more answers
In 3–5 sentences, describe how technology helps business professionals to be more efficient.
Vsevolod [243]

Technology helps business professionals, keep more organized, communicate better, and effectively keeps businesses secure. Technology helps keep employee information and business paper work more organized using computers and software; while making it easier to communicate with employee's using e-mail and memo's.

if wrong sry :(

3 0
3 years ago
Read 2 more answers
Which three decisions might a specialized drone delivering medical supplies make once it's algorithm has started and it is scann
densk [106]

The decisions that a specialized drone delivering medical supplies make once it's algorithm has started and it is scanning its surround are:

  • A  tilt backyard when sensor detects an obstacle within 10 feet.
  • To disable self flying and alert pilot when sensor detects an obstacle within 3 feet.
  • To resume normal speed when sensor doesn't detect an obstacle within two feet.

<h3>How are drones used in healthcare?</h3>

Hospitals are known to have started  using drones to transport laboratory samples and also to carry out other kinds of humanitarian aids.

The use of  drones  is said to be one that is cost-effective and it is one that bring blood products, vaccines, medical supplies, and others to rural areas or areas that has small infrastructure.

A drone can find way to move around obstacles but they should not shut down where there is obstacle.

Learn more about drone from

brainly.com/question/24530012

5 0
2 years ago
Other questions:
  • What do you call the combination of title, description, tags, and thumbnail?
    6·1 answer
  • The most popular way for hackers to take over hosts today is ________.
    15·2 answers
  • ( Game Design) The companies who get video games out to consumers are called:
    12·1 answer
  • What is project scope? a. Quantifiable criteria that must be met for the project to be considered a success b. Products, service
    5·1 answer
  • Logical design is tied to a specific hardware and software platform. a. True b. False
    9·1 answer
  • Help a brotha out..................
    10·1 answer
  • Why When I change my pfp It be blurry and it be ugly- if you know what I mean :c
    15·2 answers
  • Which of the following is not a bus type A. Address bus B. Data bus C. Memory bus D. Control bus ​
    7·2 answers
  • Pa answer po thank you​
    7·2 answers
  • 4. Compute the following additions
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!