Consider the following code snippet. Assuming that the user inputs 75 as the age, what is the output?
Int age = 0;
Scanner in = new Scanner(System.in) ;
System.out.print("Please enter your age: ") ;
Age = in.nextInt() ;
If (age < 10)
{
System.out.print("Child ") ;
}
If (age < 30)
{
System.out.print("Young adult ") ;
}
If (age < 70)
{
System.out.print("Old ") ;
}
If (age < 100)
{
System.out.print("Impressively old ") ;
}
A) Impressively old
B) Child Young adult Old
C) Young adult Old
D) Child Young adult Old Impressively old
Correct Answer:
Verified
Q24: Which of the following operators is NOT
Q41: Assuming that a user enters 5 as
Q44: What is the output of the following
Q45: What is the output of the following
Q47: What is the output of the following
Q49: What is the value of the magicPowers
Q81: Which of the following operators is used
Q84: The flow chart shows the order in
Q87: Which of the following operators is
Q98: When drawing flowcharts, unconstrained branching and merging
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents