Join the IDNLearn.com community and start getting the answers you need today. Ask any question and receive accurate, in-depth responses from our dedicated team of experts.

Write a multi-way if statement that adds 1 to the variable minors if the variable age is less than 18, adds 1 to the variable adults if age is 18 through 64, and adds 1 to the variable seniors if age is 65 or older

Sagot :

Note, this is psudocode, because i dont know what language you are coding in.

define a variable: minors

define a variable: adults

define a variable: seniors

define a variable: age

if age <18{

add one to minors

}

else if 18<age<64{

add one to adults

}

else if age >= 65{

add one to seniors

}