Write code that inputs a number and a string from the
user and determines whether
the string is "a" and the number is less than 10, between 11 and 20,
between 21 and 30, or greater than 30,
or
the character is "b" and the number is greater than 25, between 15 and
24, or less than 15.
Output telling the user which category the pair of values is in.
Don't write a complete program; just write the code necessary to
accomplish this task, including variable declarations.
int n;
while (n > 1) {
System.out.print(" "+n);
if (n%2 == 0)
n = n / 2;
else
n = 3 * n + 1;
}
System.out.print(" "+n);
Show the output when this is executed and the value
of n is 8.
of n is 5.
of n is 6.
of n is 7.