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

As the total resistance of a circuit increases, so does current. True False
What is contained within the stratosphere
Which of the following is the correct chronological order of art periods? A. Mannerism, baroque, rococo, neoclassicism B. Neoclassicism, baroque, manne
There were 20 gallons of gasoline in your car's gas tank. You used 4 gallons and 1 quart. How much gasoline remains in the tank?
tissue covers the outer surface of herbaceous or soft stemmed plants whats its called
I need help with this question
Which polynomial contains the powers in descending order? A. 3x6 + 10x2 + x8 + 8x3 - 2 B. 10x2 + 8x3 + x8 - 2 + 3x6 C. x8 + 10x2 + 8x3 + 3x6 - 2 D.
_____ is defined as the simultaneous contraction of one muscle and the relaxation of its antagonist.
Quadrilateral ABCD in the figure below represents a scaled-down model of a walkaway a historic site. Quadrilateral EFGH represents the actual walkway. ABCD is s
What is the purpose of genetically modified plants