Advertisement
Guest User

java code

a guest
Nov 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.88 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class FoodOrderingSystem{
  6. //array for Storage of menu items
  7.  
  8.     static ArrayList<Integer> itemCode = new ArrayList<Integer>();
  9.  
  10.     static ArrayList<String>  itemName = new ArrayList<String>();
  11.  
  12.     static ArrayList<Integer> itemQty  = new ArrayList<Integer>();
  13.  
  14.     static ArrayList<Double> itemPrice = new ArrayList<Double>();
  15.  
  16.     //create temporary storage for basket which contains all details of items.
  17.  
  18.     static ArrayList<Integer> basketCode = new ArrayList<Integer>();
  19.  
  20.     static ArrayList<String> basketName = new ArrayList<String>();
  21.  
  22.     static ArrayList<Integer> basketQty = new ArrayList<Integer>();
  23.    
  24.     static ArrayList<Double> basketPrice = new ArrayList<Double>();
  25.  
  26.     static ArrayList<Double> basketCost = new ArrayList<Double>();
  27.  
  28.  
  29.  
  30.     public static Scanner input = new Scanner(System.in);
  31.  
  32.     public static void main(String[] args) {
  33.  
  34.  
  35.         //add menu choices  
  36.  
  37.         itemCode.add(01);
  38.  
  39.         itemName.add("Pizza     ");
  40.  
  41.         itemQty.add(50);
  42.  
  43.         itemPrice.add(10.0);
  44.  
  45.         itemCode.add(02);
  46.  
  47.         itemName.add("Burger    ");
  48.  
  49.         itemQty.add(50);
  50.  
  51.         itemPrice.add(7.0);
  52.  
  53.         itemCode.add(03);
  54.  
  55.         itemName.add("Sandwich  ");
  56.  
  57.         itemQty.add(50);
  58.  
  59.         itemPrice.add(5.0);
  60.  
  61.         itemCode.add(04);
  62.  
  63.         itemName.add("Water     ");
  64.  
  65.         itemQty.add(30);
  66.  
  67.         itemPrice.add(1.0);
  68.  
  69.         itemCode.add(05);
  70.  
  71.         itemName.add("Soft drink");
  72.  
  73.         itemQty.add(30);
  74.  
  75.         itemPrice.add(2.0);
  76.  
  77.         itemCode.add(06);
  78.  
  79.         itemName.add("Tea       ");
  80.  
  81.         itemQty.add(20);
  82.  
  83.         itemPrice.add(2.0);
  84.  
  85.         itemCode.add(07);
  86.  
  87.         itemName.add("Coffee    ");
  88.  
  89.         itemQty.add(20);
  90.  
  91.         itemPrice.add(2.0);
  92.  
  93.         itemCode.add(08);
  94.  
  95.         itemName.add("Ice cream ");
  96.  
  97.         itemQty.add(20);
  98.  
  99.         itemPrice.add(2.0);
  100.  
  101.         itemCode.add(09);
  102.  
  103.         itemName.add("Chocolate ");
  104.  
  105.         itemQty.add(20);
  106.  
  107.         itemPrice.add(2.0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement