I dont know what i did but hen i run the main program it is not going through the switch statement. It was working last night and i haven't changed it in anyway i only added a print statement for debugging purposes. This is apart of a POS system i have to do for a class assignment.
package MultiBuy;
import static POS.POS_System.NonGSTVodka;
import static POS.POS_System.PRICE_FORMAT;
import static POS.POS_System.Vodka;
import static POS.POS_System.btnCancelPrevious;
import static POS.POS_System.nPreviousPrice;
import static POS.POS_System.nTotal;
import static POS.POS_System.strPreviousDrink;
import static POS.POS_System.txtBill;
import static POS.POS_System.spaces;
public class MultiBuy {
public static int clicked;
public static double DiscountAmt = 0.05;
public static double Discount_PRICE_Vodka = 0.385;
public static double NewVodkaPrice;
public static void MultiBuy(){
POS.POS_System.btnVodkaPressed = true;
System.out.println("No Cases Ran");
switch(clicked){
case 1:
if(clicked == 0){
//Plus 1 to clicked to create event
clicked++;
System.out.println("Case 1 Completed");
break;
}
case 2 :
if(clicked >= 2 && POS.POS_System.btnVodkaPressed == true){
txtBill.setText(txtBill.getText() + "\n" +
" " + strPreviousDrink +
spaces(40 - strPreviousDrink.length()) + "-" +
PRICE_FORMAT.format(nPreviousPrice) + "\n" + " (Canceled)\n");
nTotal -= nPreviousPrice + NewVodkaPrice;
btnCancelPrevious.setEnabled(false);
NewVodkaPrice = Vodka - Discount_PRICE_Vodka;
POS.POS_System.txtBill.setText(POS.POS_System.txtBill.getText() + "\n" + "Multibuy Special = " + MultiBuy.Discount_PRICE_Vodka);
POS.POS_System.txtBill.setText(POS.POS_System.txtBill.getText() + "New Price = " + NewVodkaPrice);
POS.POS_System.nTotal = POS.POS_System.nTotal;
clicked--;
System.out.println("Case 2 Completed");//Should equal 3
break;
}
case 3 :
if(clicked <= 1){
clicked++;
System.out.println("Case 3 Completed");//Should equal 2
break;
}
}
}
}