StudentDrive - state = keyboard.nextLine(); Student stuOne...

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

View Full Document Right Arrow Icon
/** * The StudentDrive class <Driver * for student class creates two * student objects and asks usere * for input then displays data> * @author Jeff Cox */ * import java.util.Scanner; i public class StudentDrive { public static void main(String[] args) { String name; String major; String city; String state; Scanner keyboard = new Scanner(System.in); System.out.println("Student Name: "); name = keyboard.nextLine(); System.out.println("Student Major: "); major = keyboard.nextLine(); System.out.println("Student City: "); city = keyboard.nextLine(); System.out.println("Student State: ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: state = keyboard.nextLine(); Student stuOne = new Student(name, city, state, major); System.out.println(&quot;Student Name: &quot;); name = keyboard.nextLine(); System.out.println(&quot;Student Major: &quot;); major = keyboard.nextLine(); System.out.println(&quot;Student City: &quot;); city = keyboard.nextLine(); System.out.println(&quot;Student State: &quot;); state = keyboard.nextLine(); Student stuTwo = new Student(name, city, state, major); System.out.println(stuOne.toString()); System.out.println(stuTwo.toString()); //Student stuTwo = new Student(); } }...
View Full Document

This note was uploaded on 07/28/2009 for the course CSI 161 taught by Professor Deborahpenna during the Spring '09 term at Anne Arundel CC.

Ask a homework question - tutors are online