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
Describe the certifications developed by SANS. How are they different from InfoSec certifications like CISSP and SSCP?
Nat2105 [25]

Answer:

The certification developed by the SANS is GIAC certification .In this there are 3 certification GSEC,GISF and GCED .The description of these certification is given below .

Explanation:

The GIAC certification course is providing the knowledge of the security like cryptography ,networkig knowledge etc .

GSEC:The GSEC Certification is the certification of the security.It simply means this certification certified about the security risk in the computer system .

GISF: This certification gives the knowledge of the networking as well as the security in the computer system also it gives the knowledge of the cryptography.

GCED :This certification is also providing the knowledge of security as well as networking.

Difference between GIAC and  InfoSec certifications is given below

  • The SANS certification is giving the knowledge about the security risk as well as cryptography by the professional where as the InfoSec certifications providing the knowledge of the hacking by the professional .
  • The SANS is including the certification of  GIAC certification where as the InfoSec certifications is including the  CISSP and SSCP certification .
4 0
3 years ago
Which of the following is needed if a computer with the IP address 172.31.210.10/24 wants to communicate with a computer with th
ozzi

Answer:

The answer is <em>since both ip addresses are not within the same subnet,   only router can be used for the two computers to communicate together.</em>

Explanation:

From the statements in the question, since  the two ip addresses are not on same subnet value i.e 172.31.210.10/24 and 172.31.209.122/24 then both computers cannot communicate except a router is used for network connections for the two different subnets as they are not on the same network.

Explanation:

4 0
3 years ago
Where is an exploratory robot used?
Allisa [31]
The answer is the moon, mars, etc.
6 0
3 years ago
Read 2 more answers
In 1964 in London, Ontario one could buy a chili-dog and a root beer for $1.25, today the same chili dog and root beer cost $5.0
Marta_Voda [28]

Answer:

3% inflation rise. No correct cpi option

Explanation:

Consumer Price Index(CPI) is calculated by the Bureau of Economic Analysis and Statistics of a country monthly and annually.

Consumer Price Index(CPI) is used for measuring the changes in the price level of consumer goods and services purchased by households.

Calculating the consumer price index; price in 1964= $1.25, today price= $5.0.

Therefore, consumer price index= Price in today- price in 1964÷ price in 1964,.

Consumer Price index(CPI)= $(5-1.25)/1.25 = 3.75/1.25 = 3 Percent price inflation rise.

For the first cpi; 112-80/80= 0.4 percent( not equal to the 3 Percent inflation rise).

For the second cpi: 141.6-60/60= 1.36 Percent inflation rise(not equal to the 3 Percent inflation rise).

For the third CPI: 126.4-75/75 =0.68 percent inflation rise[not equal to the 3 Percent inflation rise].

For the third CPI: 108.5-90/90=0.21 percent inflation rise(not equal to 3 Percent inflation rise)

Therefore, none of the options are right.

5 0
3 years ago
How to change the background color of a section in html
NeTakaya

Answer:

You should have a line on which you can add information below the <style> tag and above </style> tag. simply add the body tag  after <style> tag.

Explanation:

From the below code you can understand it how you can change the background color of a section in html.

<!DOCTYPE html>

<html>

<head>

<style>

body {

       background-color: #afafaf;

}

h {

background-color: #00b33c;

}

p {

background-color: #00d33c;

}

</style>

</head>

<body>

<h1>Header with green background</h1>

<p>Paragraph with lite green background</p>

</body>

</html>

3 0
3 years ago
Other questions:
  • Women make up 52 percent of the voting-age population and are more likely to vote, yet
    12·2 answers
  • When you receive five job offers what does it mean
    9·1 answer
  • The term Electronic Privacy Information Center (EPIC) refers to a form of the digital subscriber line technology, which enables
    6·1 answer
  • Which data type structures best for insersion/ removal - Stack, linked list, queue?
    15·1 answer
  • Write a program with a loop that lets the user enter a series of positive integers. The user should enter −1 to signal the end o
    7·1 answer
  • Which is an example of a correct citation for a website with an unknown author?
    9·1 answer
  • In Broadbent's filter model of attention, the stages of information processing occur in which order?
    9·1 answer
  • THE FOLLOWING IS WRITTEN IN C:
    5·1 answer
  • Which of the following would be done outside of a control room?
    5·2 answers
  • ___1. my1st JavaProgram<br> A. valid <br> B. invalid
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!