/* 
 * Coffee.java 
 * 
 * Version: 
 *     $Id$ 
 * 
 * Revisions: 
 *     $Log$ 
 */

/** 
 * Coffee discounts :
 * The Java Coffee Outlet sells only one type of coffee beans harvested 
 * exclusively in the remote area of Irian Jaya.  The company sells the 
 * coffee in 2-lb bags only,
 * and the price of a single 2-lb bag is $5.50.  Discounts are given 
 * to volume buyers.  The discount is based on the following table:
 
 * Order Volume	Discount
 * more than 25 bags	5% of the total price
 * more than 50 bags	10% of the total price
 * more than 100 bags	15% of the total price
 * more than 150 bags	20% of the total price
 * more than 200 bags	25% of the total price
 * more than 300 bags	30% of the total price

 * Write a program that accepts the number of bags ordered 
 * and prints out the total cost of the order.
 *
 */
class Coffee{

  private static int bags = 0;
  private static double discount =0;
  private static double cost = 0;
  private static double totalcost = 0;

  /** 
   * main: Contains the main part of the program. 
   *   
   * @param    args    Command line args (not used)
   *
   */
  public static void main(String args[]  )
  {
    // input or control
    bags = Integer.parseInt(args[0]);

    // model
    cost = bags *5.50;
    if ( bags > 300) {
      discount = .3 * (bags *5.50);  
      totalcost = (bags * 5.5 ) - discount;
    }
    else if ( bags < 200) {
      discount = .25 * (bags *5.50);
      totalcost = (bags * 5.5 ) - discount;
    }
    else if ( bags < 150) {
      discount = .20 * (bags *5.50);
      totalcost = (bags * 5.5 ) - discount;
    }
    else if ( bags < 100) {
      discount = .15 * (bags *5.50);
      totalcost = (bags * 5.5 ) - discount;
    }
    else if ( bags < 50) {
      discount = .10 * (bags *5.50);
      totalcost = (bags * 5.5 ) - discount;
    }
    else if ( bags < 25) {
      discount = .05 * (bags *5.50);
      totalcost = (bags * 5.5 ) - discount;
    }

    // view
    System.out.println (" Number of bags ordered: " + bags);
    System.out.println ("\n Number of bags ordered: " + bags);
    System.out.println ("\n Discount price: " + discount );
    System.out.println ("Total cost price: " + cost);
    System.out.println ("Cost price: " + totalcost);           
  }
}



