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

Propane and oxygen react according to the equation: C₃H₈(g) + 5O₂(g) → 3CO₂(g) + 4H₂O(g). How many grams of water can be produced from the complete combustion o
Henry can ride his bike 23 miles in 2 hours. The store is six miles away. About hoe long should it take Henry to ride his bike to the store?
Mrs.Savin receives a weekly base salary of $500,plus a commission of $1200 on each car that she sells. Write a function rule relating her total weekly pay p to
three things scientists learned about earth in beginning of 1800s
How far does Franklin Roosevelt deserve his reputation as one of the greatest US presidents?
A number is divided by 32 is 96. What is the number?
how do you model the square root of 16
Factor the polynomial 6b^2-17b+10
If 2x+z=2y and 2x+2y+z=20 what is the value of y?
What is the value of the 8 and 48?