Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package thomasmontezip;
  7.  
  8. /**
  9. *
  10. * @author Tom
  11. */
  12. import javax.swing.JOptionPane; //This is used to import the Message Box
  13. import java.util.*; //This imports all java untilities to be simple
  14.  
  15. public class ThomasMontezIP {
  16. /**
  17. * @param args the command line arguments
  18. */
  19. public static void main(String[] args) {
  20. Vector<SubOrder> subs = new Vector<SubOrder>();
  21.  
  22. //The following code creates and stores the information of name, beverage, sub bread, sub type, and sub size from the user.
  23. String name =
  24. JOptionPane.showInputDialog( "Enter you name:");
  25.  
  26. String beverage =
  27. JOptionPane.showInputDialog( "Please tell me your beverage choice:");
  28.  
  29. String subbread =
  30. JOptionPane.showInputDialog( "Next, please select your sub bread type:");
  31.  
  32. String subtype =
  33. JOptionPane.showInputDialog( "Next, select a sub type:");
  34.  
  35. String subsize =
  36. JOptionPane.showInputDialog( "Finally, choose a sub size:");
  37.  
  38. subs.add(new Suborder(name, beverage, subbread, subtype, subsize)
  39.  
  40. //This line takes all of the strings that were made, and compiles them into an order for the user.
  41. String message =
  42. String.format( "Hello %s.\nYou ordered a %s %s sub on %s bread, and a %s to drink.\nPlease enjoy your sub. %s", name, subsize, subtype, subbread, beverage);
  43.  
  44. //This line writes the message that was made previously in the dialog box for the user to see there order.
  45. JOptionPane.showMessageDialog( null, message);
  46.  
  47.  
  48. }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement