Write an if/else 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.
.
.
Click on the title for the solution
.
.
if (age<18) minors+=1;
else if (age<65) adults+=1;
else seniors+=1;
.
Click on the title for the solution
.
.
This is the answer:
:
if (age<18) minors+=1;
else if (age<65) adults+=1;
else seniors+=1;
Comments
Post a Comment