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
Answer import javautilScanner public class Main public static void mainString arg... View full answer
Get step-by-step solutions from verified subject matter experts
