Advertisement
vp0415

lec2.1.2

Oct 12th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GradeBookTest {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner(System.in);
  7.        
  8.         GradeBook myGradeBook = new GradeBook();
  9.        
  10.         System.out.println("Please enter the course name:");
  11.         String theName = input.next();
  12.         myGradeBook.setCourseName( theName );
  13.        
  14.         System.out.println("Please enter the instructor's name: ");
  15.         String hisName = input.next();
  16.         myGradeBook.setInstructorName( hisName );
  17.        
  18.        
  19.         System.out.println("The course's name is : " + myGradeBook.getCourseName());
  20.         System.out.println();
  21.         System.out.println("This course is presented by: " + myGradeBook.getInstructorName());
  22.         System.out.println();
  23.        
  24.         myGradeBook.displayMessage();
  25.  
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement