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
45 points!!
pav-90 [236]

Answer:

ENQUIRE database system

Explanation:

5 0
3 years ago
Read 2 more answers
Which of the following is a benefit of using a parallel circuit system?
Ad libitum [116K]

The answer is stability. In a parallel circuit the potential source or voltage remains constant even as you add additional load to the circuit. Next would be simplicity and security, do note that the normal and typical circuitry found on household uses parallel circuit model.

7 0
3 years ago
Whichof the following is not a standard method called as part of the JSPlife cycle?jspInit()jspService()_jspService()jspDestroy(
olga nikolaevna [1]

Answer:

jspService()

Explanation:

These are the steps in JSP life cycle-

1. We have to convert JSP page to Servlet.

2.Then we compile the JSP page which convert it into test.java

3. In test.java ,we load the classes(test.class) in container.

4. Object(instance) is created in container .

5. Then, we initialize the init() method at the time of servlet generation.  

6. After the initialization,for the requests we use _jspService() method to serve the incoming requests from JSP.

7. When the work of JSP is completed, we remove it from container by the help of jspDestroy() method.

There is no jspService() method in the JSP life cycle.

7 0
3 years ago
According to peacemaking criminology, our society denying a citizen's basic rights is another dimension of
katovenus [111]

Answer:

Violence.

Explanation:

Peacemaking criminology believes that our justice system it's just using a different form of violence to deal with violence.

This movement states that we need to re-enter violent individuals into society, and sees crime as a direct result of a determinate social structure, such as extreme poverty, violent environments, racial hate, etc.

4 0
3 years ago
Read 2 more answers
A computer that supports 10/100/1000 Ethernet allows for 10, 100, or 1000 ________ per second.
stich3 [128]

A Computer that supports 10/100/1000 Ethernet allows for 10,100,or 1000 gigabyte per second.

4 0
4 years ago
Other questions:
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt
    9·1 answer
  • Which is the last step in conducting a URL search?
    6·1 answer
  • An _____image is an image that appears on a web page
    8·1 answer
  • A technician has been told that a keyboard is not responding at all. What can the technician do quickly to determine whether tha
    9·1 answer
  • You are using a PowerPoint template from your school to present your research findings in front of the class. What would you do,
    13·2 answers
  • How do i do to use the cumputer very wel?
    14·2 answers
  • Match the following.
    8·1 answer
  • Hey i need some help with code.org practice. I was doing a code for finding the mean median and range. the code is supposed to b
    14·1 answer
  • I need help with computer science<br> the quiz on e2020 is on hackers and unauthorized access
    15·2 answers
  • Create a list of 5 potential jobs that students of computer science can obtain.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!