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

Which of the following statements about risks of investing in variable life funds is TRUE?
Frank Genry brief biography
Another example of axiom 3 math grade 8
How is the area of the base the same as the volume of the cylinder when the height is 1.please help​
Why was the Soviet Union displeased with actions in West Germany? A. German soldiers were stationed on the Soviet border. B. Free and fair elections were held t
different between management and leadership in business study​
The Royal Botanical Gardens at Kew were famous because they were designed by a king. - True - False Answer: False (edg 24')
Omar took out a $20,000 loan for 146 days and was charged simple interest. The total interest he paid on the loan was $488.
You borrow $12 from a friend and pay back $8. To help you understand your finances, evaluate the following expression: -12+8
The human heart is approximately the size of ________. 1) a golf ball. 2) an adult's fist. 3) a chestnut. 4) a grapefruit.