Assignment1 - number = console.nextInt read an integer...

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

View Full Document Right Arrow Icon
// Assignment #: 1 // Name: Michael Brown // StudentID: 1200601055 // Lecture: MWF 12:55pm-1:45pm // Description: This class reads an integer from a keyboard and prints it out // along with other messages. / import java.util.Scanner; // use the Scanner class located in the "java.util" directory public class Assignment1 { public static void main (String[] args) { int number; Scanner console = new Scanner(;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: number = console.nextInt(); // read an integer entered by a user // display the number with other messages System.out.print("This program reads an integer from a keyboard,\n" + "and prints it out on the display screen.\n" + "The number is " + number + ".\n" + "Make sure that you get the exact same output as the expected one.\n"); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online