Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String string1 = JOptionPane.showInputDialog("How many quarters do we add?:");
- // If the user enters a number above 0 in the text box, then the program sets that
- // value to the number of quarters to add. Otherwise, the program errors out.
- if (string1.equals("") == true || Integer.parseInt(string1) < 0){
- JOptionPane.showMessageDialog (
- null, "Please enter a positive or zero value for the added money.\nNo money added.",
- "Number Error",
- JOptionPane.ERROR_MESSAGE);
- addedQ = 0;
- addedD = 0;
- addedN = 0;
- addedP = 0;
- }else {
- addedQ = Integer.parseInt(string1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement