Advertisement
calcpage

C4X17_MonthTester.java

Oct 28th, 2011
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. /*
  2. MonthTester.java    MrG 2011.1027
  3. purpose: enter month # month name using String class
  4. required:   MonthTester.java        main class
  5.         Month.java          derived class
  6. translator: javac MonthTester.java
  7. interpreter:    java MonthTester
  8. */
  9.  
  10. //imported class
  11. import java.util.Scanner;
  12.  
  13. public class MonthTester
  14. {
  15.     public static void main(String[] args)
  16.     {
  17.         Scanner in = new Scanner(System.in);
  18.         System.out.println("enter month as a number: ");
  19.        
  20.         int month = in.nextInt();
  21.         Month joey = new Month(month);
  22.  
  23.         System.out.println("The month is " + joey.getName());
  24.     }
  25. }  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement