lucycbrumby9908 lucycbrumby9908
  • 04-04-2020
  • Computers and Technology
contestada

Write a statement that declares a variable of the enumerated data type below. enum Flower { ROSE, DAISY, PETUNIA } The variable should be named flora. Initialize the variable with the ROSE constant.

Respuesta :

sodiqlekan8
sodiqlekan8 sodiqlekan8
  • 06-04-2020

Answer:

enum Flower { ROSE, DAISY, PETUNIA }

Flower flora = Flower.ROSE

Explanation:

Flower is of Enumeration data type and it contains the constants ROSE, DAISY and PENTUA.

To write a statement that declares a variable of that type you use

Var_of_enum_type Var_name

And to initialize it with a constant of the enumeration data type you use the dot (.) operator.

Var_of_enum_type.CONSTANT

Answer Link

Otras preguntas

The republics of the USSR declared themselves: satellites counties independent countries a federation
if 5y = 1 over 25, what is y?
How did Reconstruction affect daily life in South Carolina?
What year did Magellan set sail for circumnavigating the world
Is there a difference of squares in 4(4n^2-9) The original question was to factor 16n^2-36 completely and I was wondering if you could factor it further or if
what was the closest source of marble to rome
Is the legacy of the civil war still apparent today? How?
Use the following quote from Adam Smith to answer the question below: "It is not from the benevolence of the butcher, the brewer, or the baker that we expect ou
Analyze the ways in which farmers and industrial workers responded to industrialization in the Gilded Age (1865-1900).
What specialist would care for the trachea?