Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num, num2, totalcur, totalall = 0, confirm;
- do {
- num = Integer.parseInt(JOptionPane.showInputDialog("Enter number"));
- num2 = Integer.parseInt(JOptionPane.showInputDialog("Enter another number"));
- totalcur = num+num2;
- totalall = totalcur+totalall;
- confirm = JOptionPane.showConfirmDialog(null, "Current total is: " + totalall + ". Input more number?");
- }
- while (confirm!=1);
- JOptionPane.showMessageDialog(null,"Overall total is: " + totalall);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement