sorry if this is the wrong place to ask this sort of question but i am a complete newbie at java and i was wondering is there a way to make this more compact:
if (PlainFlourUsed <2000)
System.out.println("\n0 Bags of Flour needed");
else if (PlainFlourUsed >= 2000 && PlainFlourUsed < 4000)
System.out.println("\n1 Bag of flour needed");
else if (PlainFlourUsed >= 4000 && PlainFlourUsed< 6000)
System.out.println("\n2 Bag's of flour needed");
else if (PlainFlourUsed >= 6000 && PlainFlourUsed < 8000)
System.out.println("\n3 Bag's of flour needed");
else if (PlainFlourUsed >= 8000 && PlainFlourUsed< 10000)
System.out.println("\n4 Bag's of flour needed");
else if (PlainFlourUsed >= 10000 && PlainFlourUsed < 12000)
System.out.println("\n5 Bag's of flour needed");
else if (PlainFlourUsed >= 12000 && PlainFlourUsed< 14000)
System.out.println("\n6 Bag's of flour needed");
else if (PlainFlourUsed >= 14000 && PlainFlourUsed < 16000)
System.out.println("\n7 Bag's of flour needed");
else if (PlainFlourUsed >= 16000 && PlainFlourUsed< 18000)
System.out.println("\n8 Bag's of flour needed");
else if (PlainFlourUsed >= 20000 && PlainFlourUsed < 22000)
System.out.println("\n9 Bag's of flour needed");
else if (PlainFlourUsed >= 24000 && PlainFlourUsed < 26000)
System.out.println("\n10 Bag's of flour needed");
EDIT but using that will give me a division but i can only display bags of flour such a 1 or 2. i cannot have 1.125 of a bag of flour. only whole bags of flour
if
s skip 2000. Is that a mistake? – shmosel Dec 21 '16 at 20:31