title: Java program not working
body: <p>my java program will not calculate the discounts correctly and I can't figure out why.
  I am new to java and I don't know how to fix this so any help would be appreciated.
  For example if you buy 100 bags your discount should be 82.50 but mine is saying that it is 27.50</p>
  
  <pre><code>import java.text.DecimalFormat;
  import java.util.Scanner;
  public class Coffee {
      public static void main(String args[]){
          Scanner bags = new Scanner(System.in);
          System.out.println("Hello and welcome to the program");
          System.out.println("Here is the discount list for the IT125 Coffee Company");
          System.out.println("&lt;= 24 Bags      No discount");
          System.out.println("&gt;= 25 Bags      5% ");
          System.out.println("&gt;= 50 Bags      10% ");
          System.out.println("&gt;= 100 Bags     15% ");
          System.out.println("&gt;= 150 Bags     20% ");
          System.out.println("&gt;= 200 Bags     25% ");
          System.out.println("&gt;= 300 Bags     30% ");
          System.out.println("");
  
          DecimalFormat df = new DecimalFormat("0.00");
          int num1;
          System.out.print("Enter the number of bags purchased: ");
          num1 = bags.nextInt();
          System.out.println("Bags purchased " + num1);
          double cost, disc, totcost;
          totcost = 0;
          disc = 0;
          cost = num1 * 5.50;
          System.out.println("Normal Price: € " + df.format(cost));
  
  
  
          if (num1 &lt; 25) {
              System.out.println("Your dicount is " + disc);
              totcost = cost - disc;
              System.out.print("Your total cost is € " + df.format(totcost));
          }
  
          else if (num1 &gt;= 25) {
              disc = cost * 0.05;
              totcost = cost - disc;
              System.out.println("Your dicount is € " + df.format(disc));
              System.out.print("Your total cost is € " + df.format(totcost));
          }
  
          else if (num1 &gt;= 50) {
              disc = cost * 0.1;
              totcost = cost - disc;
              System.out.println("Your dicount is € " + df.format(disc));
              System.out.print("Your total cost is € " + df.format(totcost));
          }
  
          else if (num1 &gt;= 100) {
              disc = cost * 0.15;
              totcost = cost - disc;
              System.out.println("Your dicount is € " + df.format(disc));
              System.out.print("Your total cost is € " + df.format(totcost));
          }
  
          else if (num1 &gt;= 150) {
              disc = cost * 0.2;
              totcost = cost - disc;
              System.out.println("Your dicount is € " + df.format(disc));
              System.out.print("Your total cost is € " + df.format(totcost));
          }
  
          else if (num1 &gt;= 200) {
              disc = cost * 0.25;
              totcost = cost - disc;
              System.out.println("Your dicount is € " + df.format(disc));
              System.out.print("Your total cost is € " + df.format(totcost));
  
          }
  
          else if (num1 &gt;= 300) {
              disc = cost * 0.3;
              totcost = cost - disc;
              System.out.println("Your dicount is € " + df.format(disc));
              System.out.print("Your total cost is € " + df.format(totcost));
          }
  
      }
  
  }
  </code></pre>