SHARE
TWEET

APCS2012_C4X17_MonthConverter.java

calcpage Oct 19th, 2012 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. MonthConverter.java     MrG     2012.1019
  3. purpose:        translates numbers to month names
  4. required files: MonthConverter.java             main class
  5.                 Month.java                      derived class
  6. translator:     javac MonthConverter.java
  7. interpreter:    java MonthConverter month
  8. */
  9.  
  10. //main class
  11. public class MonthConverter
  12. {
  13.         public static void main(String[] args)
  14.         {
  15.                 int month = Integer.parseInt(args[0]);
  16.  
  17.                 Month harinee = new Month(month);
  18.  
  19.                 System.out.println("month # " + month + " is " + harinee.getName());
  20.         }
  21. }
RAW Paste Data
Top