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
Serjik [45]
3 years ago
6

In the Happy Valley School System, children are classified by age as follows: less than 2, ineligible 2, toddler 3-5, early chil

dhood 6-7, young reader 8-10, elementary 11 and 12, middle 13, impossible 14-16, high school 17-18, scholar greater than 18, ineligible Given 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:
sasho [114]3 years ago
5 0

// C++ switch

// It can also be used for JAVA, C#

switch(age){

// here age will be sent by the function in which it is used

// case to check the age<2

case(age<2 && age>0):

// printing the line

cout<<"ineligible";

// case to check the age ==2

case(age==2):

// printing the line

cout<<"toddler";

// case to check 3-5

case(age>=3 && age<=5):

cout<<"early childhood";

// case to check 6-7

case(age==6 || age==7):

cout<<"young reader";

//case to check 8-10

case(age>=8 && age<=10):

cout<<"elementary";

// case to check 13

case(age==13):

cout<<"impossible";

//case tocheck 14-16

case(age>=14 && age<=16):

cout<<"high school";

// case to check 17 or 18

case(age==17 || age==18):

cout<<"scholar";

//case to check >18

case(age>18);

cout<<"ineligible";

// default case

default:

cout<<"Invalid age";

}

Read more on Brainly.com - brainly.com/question/12981906#readmore

You might be interested in
How did<br> technological artifacts evolved over time?
adell [148]
With helping us communicate with each other and around the world with the internet and other different types of things like,Tesla’s,phones,touch screen IPads,even having a built in TV plane
3 0
2 years ago
What hand glove is used to prevent electric shock and why​
Ostrovityanka [42]

Answer:

Insulated gloves because their made of synthetic rubber.

Explanation:

7 0
3 years ago
Read 2 more answers
People who are reading this:
Gnom [1K]

Answer:

Awe thanks hun!

Explanation:

3 0
3 years ago
Read 2 more answers
Is a ROUTER required for Internet Connectivity ?<br> Yes<br> No
Kazeer [188]

no it is not but u will need a ethernet cord

5 0
3 years ago
4.which pre-defined feature is known as functions in Excel?<br> a.formula<br> b.property<br> c. data
lesya692 [45]

Answer:

I think formula?

Explanation:

8 0
2 years ago
Other questions:
  • Shawn works at the local electrical company in Nampa, ID, which provides electricity to the entire city of Boise. This area is p
    6·1 answer
  • What is an example of constructive criticism for an employee who is shy during meetings?
    15·2 answers
  • Sarah wants to calculate how much of a profit she would make on producing and selling a new product. Sarah should use a _____.
    13·1 answer
  • In today's digital marketplace, the line between retailer and distributor has become less distinct.
    13·1 answer
  • The mods have peanuts for brains (it's true, I lost like 1k points to them for no reason)
    12·1 answer
  • A specialized security administrator responsible for performing systems development life cycle (SDLC) activities in the developm
    11·1 answer
  • What are some benefits of 3-D printing?
    9·1 answer
  • Create a Python program that asks the user in which direction to go? north, South East, or West?
    12·1 answer
  • You often need to have several applications open at the same time. Which requirement is related to this need?
    11·1 answer
  • How to calculate 3 X (50 + 40) ÷ 5 on excel 2016
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!