Question
Code a variable of type Scanner and name it input Read in the user's favorite number and assign it to an integer variable named favNum.
Code a variable of type Scanner and name it input Read in the user's favorite number and assign it to an integer variable named favNum. Note: be sure to prompt the user before reading in the number. Users don't know what you want unless you tell them. Read in the user's age and assign it to an integer variable called age Note: be sure to prompt the user before reading in the number. Users don't know what you want unless you tell them. Read in the user's name and assign it to a String variable called name Note: be sure to prompt the user before reading in the number. Users don't know what you want unless you tell them. Print out the user's name, age, and favorite number using the printf statement, be sure to label your outputs. Sample Output: Karen your favorite number is 32 and you are 55 years old.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Answer import javautilScanner public class Main public static void mainString arg...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started