1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ankoles [38]
3 years ago
6

In the Happy Valley School System, children are classified by age as follows:less than 2, ineligible2, toddler3-5, early childho

od6-7, young reader8-10, elementary11 and 12, middle13, impossible14-16, high school17-18, scholargreater than 18, ineligibleGiven an int variable age, write a switch statement that prints out, on a line by itself, the appropriate label from the above list based on age.
Computers and Technology
1 answer:
Greeley [361]3 years ago
7 0

Answer:

int age = 10;

switch (age){

case 0:

case 1:

System.out.println("ineligible");

break;

case 2:

System.out.println("toddler");

break;

case 3:

case 4:

case 5:

System.out.println("early childhood");

break;

case 6:

case 7:

System.out.println("young reader");

break;

case 8:

case 9:

case 10:

System.out.println("elementary");

break;

case 11:

case 12:

System.out.println("middle");

break;

case 13:

System.out.println("impossible");

break;

case 14:

case 15:

case 16:

System.out.println("high school");

break;

case 17:

case 18:

System.out.println("scholar");

break;

default:

System.out.println("ineligible");

}

Explanation:

In java and many other programming languages, a switch statement is a way of having multiple branching options in a program. This is usually considered a more efficient way than using multiple if....else if statements. and the expression variables could be byte, char int primitive data types. etc. every branch (option) in a switch statement is followed by the break statement to prevent the code from "falling through". In the question The variable age is declared as an int and initialized to 10. and tested against the conditions given in the question.

You might be interested in
I'm gonna get grounded for getting a 52 on my test :(
Alla [95]

Answer:

well thats not good

Explanation:

5 0
3 years ago
Consider the concept of cultural lag. Identify two American values that are “lagging.” What are three norms that are lagging? Ho
shepuryov [24]

Answer:

The cultural lag describes what actually takes place in the social system when the ideals that governs the society are not able to keep pace with the advances that are most of the time, but not actually always the technological advances. There norms are life support, stem cell research and findings, and cancer vaccines when we deal with American society, which is quite the fastest to keep pace with the technological advancement in general. Its possible now technologically to keep a person alive than he normally lives, but society still needs to accept this. The others are similar, and hence the other two norms. United States is a developed civilization, however still the life after death has not been accepted, however, extended life is definitely a possibility now. Its is quite expected however that soon it is going to be accepted. Hence, its a matter of time only, but since it has been not accepted till now it is a cultural lag. Stem cell research is also a similar situation. But soon it will be accepted as well.  Hence, US can be supposed to be the most advanced society, and the above cultural lags are for the time being only, and soon will be accepted. None of the other countries, you can expect these to be accepted currently. That is why US is the most advanced society of the world. However, some ethical conflicts and crisis still exist, but it will be removed soon, which is expected.

Explanation:

The answer is self explanatory.

7 0
3 years ago
How many of you got the right answer from this app​
Flura [38]
Actually, a lot, and it’s especially helpful when the answer is expert verified
8 0
3 years ago
The class Date has a single constructor that accepts the integer value: a month- (1 for January through 12 for December), a day
vaieri [72.5K]

Answer:

public class Date{

Public Date(int month,int day,int year){

}

}

void main(){

Date datep=new Date(3,12,2006);

}

Explanation:

Here we declared a class "Date" and defined one public constructor which will take month,day and year. In main we created an object to that Date class by invoking this parameterized constructor and assigned that object to "dateap" Date variable

8 0
3 years ago
To meet the requirement for the number of vdss on board, what must be true about pyrotechnic vdss?
asambeis [7]

Answer: They must be dated.

Explanation: If pyrotechnic VDSs are used, they must be dated. Expired VDSs may be carried on board, but a minimum of three unexpired VDSs must be carried in the vessel.

5 0
3 years ago
Other questions:
  • Which of the following is a justification for giving a Page Quality (PQ) rating of Lowest? Select all that apply. True False The
    7·1 answer
  • How does technology set a negative impact on the adolescent of our society?
    14·1 answer
  • How do you change brightness on acer laptop?
    7·1 answer
  • How can i complain a rude comment
    7·1 answer
  • 5. The stage of engine operation when both the intake and exhaust valves are closed is the _______ stage.
    5·1 answer
  • What tasks does google do?
    5·1 answer
  • A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front doo
    7·1 answer
  • IT professionals should help to protect users’ personal information, such as bank account information or Social Security numbers
    14·1 answer
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
  • Describe comm<br>unication cycle​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!