simple programing
<p>I'm trying to create a basic program where I need to ask a question, then read the input and then compare the info given with a set of info that I already have. </p>

<p>If it is valid I display the set of information that comes with this data if it is invalid it says error and repeat the question until I get to where they just press enter. When this is done I want it to display all the sets of data that was fetched from the list. also in this prices it will be help full if there is some items that come up 4 times the item is times by 0.8 to give a 20% discount. this method should also be displayed in the end result.</p>

<p>Here is what I have got so far</p>

<pre><code>import java.io.*;
import java.text.DecimalFormat;

public class CheckoutProgram {
 private static final int MAX_ARRAY_SIZE = 1000;  

 public void start(){
 sytem.out.println("this displays my name");
 itemsOfPurchases = new int [1000];

 System.out.println("Enter item code (press enter to finish):");
 String codeForItem= keyboard.readInput();

 if (codeForItem==itemcode){

 while (codeForItem==itemCode){
 for (int i=0;i&lt; itemsOfPurchase.length;i++);
  itemsOfPurchase[i]=itemsOfPurchaseArray;
  System.out.println(description);
  System.out.println("Enter item code (press enter to finish):");
 String codeForItem= keyboard.readInput();
  }
  }
  }else{
  if (codeForItem!=itemcode){
  System.out.println("Invalid item code, please try again!");
  }
  }

  }else{
  if( codeForItem == ("") ){
  for(int i=0; i&lt;itemsOfPurchases.length;i++){
  sumOfitemsOfPurchase += itemsOfPurchase[i];

   system.out.println(itemsOfPurchase);
   }
   }



  }
 }








 public void start() {
  final String UPI = "soos003";   
  SalesItem[] items;              
  SalesItem[] purchases;          
  int itemCount;                  
  int purchaseCount;              



 }


    private int checkOut(SalesItem[] items, int itemCount, SalesItem[] purchases){
 itemsOfPurchases = new int [1000];
 sytem.out.println("Enter item code (press enter to finish):");
 String codeForItem= keyboard.readInput();
 if (codeFromItem==itemCode){
 for (int i=0;i&lt; itemsOfPurchase.length;i++);
  itemsOfPurchase[i]=itemsOfPurchaseArray;
  int itemValues=itemsOfPurchase; 
  return description;  
 }

 this method looks up itemCode in the array of stock items
 private SalesItem findItem(String itemCode, SalesItem[] items, int itemCount){



  return null; 
 }

this method calculates and displays the final bill (with discounts)
 private void displayBill(SalesItem[] purchases, int purchaseCount){



 }



 private int loadStock(SalesItem[] items){
      String theLine;
      int itemCount = 0;
  try {
      BufferedReader br = new BufferedReader(new FileReader("stock.txt"));
      while ((theLine = br.readLine()) != null) {
           String[] parts = theLine.split(",");
           items[itemCount] = new SalesItem(parts[0],parts[1],Double.parseDouble(parts[2]));
           if (parts.length==4){
            String discount = parts[3];
            String numPurchases = discount.substring(0, discount.indexOf("@"));
            String price = discount.substring(discount.indexOf("@")+1);
            items[itemCount].setNumPurchases(Integer.parseInt(numPurchases));
            items[itemCount].setDiscountedPrice(Double.parseDouble(price));
     }
           itemCount++;
      }
  }
  catch (IOException e) {
      System.err.println("Error: " + e);
  }
  return itemCount;
 }
}
</code></pre>
