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
1. A green traffic sign means
NeX [460]

Answer:

general regulatory and speed control.

7 0
3 years ago
What is the primary uses of cell phone
den301095 [7]

Some primary uses of cell phones include, keeping in touch with friends or family. As well as communicating to work and to have in the event of an emergency.

8 0
3 years ago
Read 2 more answers
In a _____ cloud, a participating organization purchases and maintains the software and infrastructure itself.
notka56 [123]

Answer:

"Private" is the right solution.

Explanation:

  • Application servers supplied sometimes over the World wide web or through a personal corporate network as well as to chosen customers rather than the community benefit of the entire, is termed as the private cloud.
  • It provides companies with the advantages of a cloud environment that include self-checkout, adaptability as well as flexibility.
6 0
3 years ago
Anyone have good websites to cure boredom
Sav [38]

Answer:

cool math if its not blocked

Explanation:

6 0
3 years ago
Read 2 more answers
In which slot is a video card most commonly installed within a laptop?
IgorLugansk [536]

Answer:

<u>PCIe</u> is used for video card installation on Laptop.

Explanation:

Good quality applications, videos and games required graphics card for better results. These card can be installed on laptops, that required some ports.

PCI-e is a slot, that is used in laptop for video or graphic card interface. Video card or graphic card is used to enable high quality video or graphics on Laptop.

PCI- E stand for Peripheral Component Interconnect Express. It work as serial communication interface for high speed device.

7 0
3 years ago
Other questions:
  • A group of accountants encrypt the emails they send to your company because they contain highly sensitive financial information.
    11·1 answer
  • This type of brake fade is caused by the brake fluid becoming so hot that it boils:a. Fluid fade b. Hydraulic fade c. Heat fade
    7·1 answer
  • Courts are struggling with the privacy implications of GPStracking. In 2009, New York’s highest court held that policeofficers m
    8·1 answer
  • The average price of milk increased from $3.00 last year to $3.50 this year. This is most likely due to:
    14·1 answer
  • Identify the type of error described
    6·1 answer
  • Computer can do work very___​
    7·2 answers
  • The remove() method in the Queue interface ________. Group of answer choices retrieves, but does not remove, the head of this qu
    14·1 answer
  • How has music changed with the use of technology?
    14·1 answer
  • a publication usually issued daily,weekly or other regular times that provides news,views,features and other information of publ
    8·1 answer
  • Which era marked a switch from agricultural practices to industrial practices?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!