Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Operating System questions