Example2_17

Example2_17 - //Line 6 lastName = console.next(); //Line 7...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
4 import java.util.*; i public class Example2_17 { static Scanner console = new Scanner(System.in); public static void main(String[] args) { String firstName; //Line 1 String lastName; //Line 2 int age; //Line 3 double weight; //Line 4 System.out.println("Enter first name, last name, " + "age, and weight separated " + "by spaces."); //Line 5 firstName = console.next();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Line 6 lastName = console.next(); //Line 7 age = console.nextInt(); //Line 8 weight = console.nextDouble(); //Line 9 System.out.println("Name: " + firstName + " " + lastName); //Line 10 System.out.println("Age: " + age); //Line 11 System.out.println("Weight: " + weight); //Line 12 } }...
View Full Document

Ask a homework question - tutors are online