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

A store sells T-shirts $10 each and jeans for $20 a pair. Anna spends $150 for T-shirts and jeans. she buys x T-shirts and y pairs of jeans. what is the equatio
What was the mission of al-Qaeda?
Which of the following correctly explains the criteria for something considered to be case law
what adventure did Polydectes suggest that Perseus undertake?
Jonah had 4 books Stacy had 7 books how many books did they not have
As a result of the peloponnesian war Sparta was
The words "high altitudes, harsh climate, and few trees" describe which United States ecosystem? Alpine Deciduous forest Desert Grassland
Which character is not considered minor in The Tragedy of Julius Caesar? Lucius Messala Claudio Brutus
Which of these is a major reason colonists came to Massachusetts? "Colonial America has great farmland." "Colonial America offers religious freedom." "The Ameri
Oranges have hundreds of seeds. What does this tell us about their pollination?