brixium

Principale

Feb 17th, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package calcolatrice;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. public class Principale {
  8.  
  9.     /**
  10.      * @param args the command line arguments
  11.      */
  12.     public static void main(String[] args) {
  13.         InputStreamReader isr=new InputStreamReader(System.in);
  14.         BufferedReader br=new BufferedReader(isr);
  15.         System.out.println("Inserisici il tuo calcolo");
  16.         try {
  17.             String s=br.readLine();
  18.             Calcolatrice c = new Calcolatrice(s);
  19.             System.out.println(c.risultato());
  20.         } catch (IOException ex) {
  21.             System.err.println(ex);
  22.         } catch(java.lang.NumberFormatException ex){
  23.             System.err.println(ex);
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment