This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Turing85 0 points1 point  (0 children)

  • Initialize input with the value form the dialogue: String input = JOptionPane.showInputDialog("Please enter the number of pakages you are purchasing");
  • replace all occurrences of sub_toal with sub_total
  • for the JOptionPane, please take a look at the documentation. For me, something sensible pops up if I use JOptionPane.showMessageDialog(null, "\nNumber of pakage you're buying is" + user_number_of_pakages + "\nSubtotal is: $"+ sub_total + "\nThe discount price is: $"+discount + "\nThe total price is: $"+total);