import java.io.DataInputStream; import java.io.*; class Lab1 { public static void main(String args[]) throws IOException { DataInputStream in = new DataInputStream(System.in); float discount=0.0f,floatcost,amount=0.0f; int item; System.out.println("enter the iem\n1.T-shirt 10%\n2.Silk Sari 30%\n 3.Baby suit 40%\n 4.Trousers 15%\n"); item=Integer.parseInt(in.readLine()); switch(item) { case 1: System.out.println("enter the cost of tshirt\n"); floatcost=Float.valueOf(in.readLine()) .floatValue(); discount=(float)0.1*floatcost; amount=floatcost-discount; break; case 2: System.out.println("enter the cost of silksary\n"); floatcost=Float.valueOf(in.readLine()) .floatValue(); discount=(float)0.30*floatcost; amount=floatcost-discount; break; case 3: System.out.println("enter the cost of babasuit\n"); floatcost=Float.valueOf(in.readLine()) .floatValue(); discount = (float)0.40* floatcost; amount=floatcost-discount; break; case 4: System.out.println("enter the cost of trousers\n"); floatcost=Float.valueOf(in.readLine()) .floatValue(); discount=(float)0.15*floatcost; amount=floatcost-discount; break; default: System.out.println("invalid"); } System.out.println("amount paid is:" + amount); } }