summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe12/UpnMain.java
blob: 30c3204bde49f0d5f4e4d290bf5736cb4687fe92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
 * 
 */
package de.fhswf.in.inf.java1.aufgabe12;

/**
 * A class that provides a main.
 *
 * @author $Author: $
 * @version $Revision: $, $Date: $ UTC
 */
public final class UpnMain
{

   /**
    * Private constructor for utility class.
    *
    */
   private UpnMain()
   {
   }

   /**
    * Main entry point for the exercise 11.
    *
    * @param args
    *           Command line arguments.
    */
   public static void main(String[] args)
   {

      UPN test = new UPN();

      try
      {
         test.calculate("5 3 - 2 * 10 9 - / 10 6 - 8 6 - 2 * / -");
         System.out.println(test.getResult());
         test.calculate("-3.1415 abs cos");
         System.out.println(test.getResult());
      }
      catch (IllegalArgumentException e)
      {
         System.err
               .println("UPN string encountered error: " + e.getMessage());
      }
   }

}