daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Oct 18th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import javax.swing.JOptionPane;
  2. import javax.swing.JTextArea;
  3. import javax.swing.JScrollPane;
  4.  
  5. public class TestCashier {
  6.  
  7.    
  8.         public static void main(String[] arg)
  9.         {
  10.    
  11.  
  12.    
  13.  
  14.     String itemName;
  15.     int itemAmount;
  16.     double itemPrice;
  17.    
  18.     Cashier c = new Cashier();
  19.    
  20.     itemName = GetData.getWord("Enter name of item");
  21.     itemAmount = GetData.getInt("How many");
  22.     itemPrice = GetData.getDouble("Enter price of item");
  23.     c.add(itemName, itemAmount, itemPrice);
  24.    
  25.     itemName = GetData.getWord("Enter name of item");
  26.     itemAmount = GetData.getInt("How many");
  27.     itemPrice = GetData.getDouble("Enter price of item");
  28.     c.add(itemName, itemAmount, itemPrice);
  29.    
  30.     itemName = GetData.getWord("Enter name of item");
  31.     itemAmount = GetData.getInt("How many");
  32.     itemPrice = GetData.getDouble("Enter price of item");
  33.     c.add(itemName, itemAmount, itemPrice);
  34.    
  35.     itemName = GetData.getWord("Enter name of item");
  36.     itemAmount = GetData.getInt("How many");
  37.     itemPrice = GetData.getDouble("Enter price of item");
  38.     c.add(itemName, itemAmount, itemPrice);
  39.    
  40.    
  41.    
  42.     c.calculate();
  43.    
  44.    
  45.     String recipt = "\n"+ itemName + "......"+ itemPrice +"......"+ Cashier.getamountDue() ;
  46.            
  47.    
  48.    
  49.     JTextArea text = new JTextArea(recipt, 5, 15);
  50.     JScrollPane scroll = new JScrollPane(text);
  51.    
  52.    
  53.    
  54.        
  55.         JOptionPane.showMessageDialog(scroll, recipt, recipt, JOptionPane.INFORMATION_MESSAGE);
  56.    
  57.    
  58.      
  59.      
  60.      }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top