gvsu/cs621/proj2/MyApp.java
josh 6856920fa3 added proj2 .java files
git-svn-id: svn://anubis/gvsu@75 45c1a28c-8058-47b2-ae61-ca45b979098e
2008-03-21 20:50:52 +00:00

38 lines
925 B
Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
* MyApp is the driver class for Calculator
*/
public class MyApp
{
/**
* main is the entry point of the program
*/
public static void main (String args[])
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Calculator myCalc = new Calculator();
/* loop reading input lines until the user is finished */
for (;;)
{
System.out.println("Enter rational RPN expression (enter empty line to quit):");
String line;
try
{
line = in.readLine();
}
catch (Exception e)
{
System.out.println("Problem reading a line!");
return;
}
if (line.equals(""))
break;
myCalc.run(line);
}
}
}