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

What is the formula for the volume of a cuboid?
In what respect does an atom of magnesium differ from a magnesium ion (Mg^{2+})? (A)The ion has a more stable electronic arrangement than the atom. (B)The pos
How many light sources do you know Pls list them
How do you do this algebra question
whats Henry Hudson interesting facts?
A sequence has an initial value of 10 and each term is twice the previous term. Which function models this sequence?1) a(n)=10(2)^n2) a(n)=10(2)^n-13) a(n)=10+2
what are two human uses for mosses?
Genetic crosses Question:A brown coat is dominant to a white coat in cattle.  A farmer has a brown bull.  How would you determine whether the bull is a heteroz
A sequence has an initial value of 10 and each term is twice the previous term. Which function models this sequence?1) a(n)=10(2)^n2) a(n)=10(2)^n-13) a(n)=10+2
what is the cubic root of - 250