Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package thomasmontezip;
- /**
- *
- * @author Tom
- */
- import javax.swing.JOptionPane; //This is used to import the Message Box
- import java.util.*; //This imports all java untilities to be simple
- public class ThomasMontezIP {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Vector<SubOrder> subs = new Vector<SubOrder>();
- //The following code creates and stores the information of name, beverage, sub bread, sub type, and sub size from the user.
- String name =
- JOptionPane.showInputDialog( "Enter you name:");
- String beverage =
- JOptionPane.showInputDialog( "Please tell me your beverage choice:");
- String subbread =
- JOptionPane.showInputDialog( "Next, please select your sub bread type:");
- String subtype =
- JOptionPane.showInputDialog( "Next, select a sub type:");
- String subsize =
- JOptionPane.showInputDialog( "Finally, choose a sub size:");
- subs.add(new Suborder(name, beverage, subbread, subtype, subsize)
- //This line takes all of the strings that were made, and compiles them into an order for the user.
- String message =
- 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);
- //This line writes the message that was made previously in the dialog box for the user to see there order.
- JOptionPane.showMessageDialog( null, message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement