Consider the following if statement that classifies people according to their age. The programmer who wrote this code was careless when indenting. The syntax, however, is correct. Assume that age is...


Consider the following if statement that classifies people according to their age. The programmer who wrote this code was careless when indenting. The syntax, however, is correct. Assume that age is an int variable containing a positive value.


if (age


System.out.println("You belong to Group 1");


else if (age > 12)


if (age


System.out.println("You belong to Group 2");


else if ( (age > 20) && (age <>


System.out.println("You belong to Group 3");


else


System.out.println("You belong to Group 4");


else


System.out.println("You belong to Group 5");


a. How old are the people in Group 1?


b. How old are the people in Group 2?


c. How old are the people in Group 3?


d. How old are the people in Group 4?


e. How old are the people in Group 5?


f. Does the previous code account for all ages?



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here