Back To Java Flow of Control Index
//program to calculate discount on a price,if price is above 1000 then discount is 10% otherwise 5 % public class discountprice { public static void main(String[] args) { float price,discount; price=2000; if(price>=1000) { discount=0.1f*price; } else { discount=0.05f*price; } System.out.println("discount is " + discount); } }