import javax.swing.JOptionPane; /** Questo programma collauda i dati in ingresso acquisiti con una finestra di dialogo. */ public class InputTest { public static void main(String[] args) { Purse myPurse = new Purse(); String input = JOptionPane.showInputDialog("Quanti nickel hai ?"); int count = Integer.parseInt(input); myPurse.addNickels(count); input = JOptionPane.showInputDialog("Quanti dime hai ?"); count = Integer.parseInt(input); myPurse.addDimes(count); input = JOptionPane.showInputDialog("Quanti quarter hai ?"); count = Integer.parseInt(input); myPurse.addQuarters(count); double totalValue = myPurse.getTotal(); System.out.println("Il totale e'" + totalValue); System.exit(0); } }