You are on page 1of 2

import java.util.

*;

public class MyClass {

public static void main(String args[])

Scanner kb=new Scanner (System.in);

System.out.println("Enter the code from 1-3");

int code=kb.nextInt();

int price=100, tax=2 , fp=102;

String item = "table";

String item2="chair";

String item3="wardrobe" ;

int price2=200, tax2=10 , fp2=210;

int price3=300, tax3=30 , fp3=330;

switch(code)

case 1:System.out.println("Your item is " +item+ " The price before tax is ,"+price+" your code is
"+code+". The tax is "+tax+". The price after tax is "+fp);

break;

case 2:System.out.println("Your item is " +item2+ " The price before tax is ,"+price2+" your code is
"+code+". The tax is "+tax3+". The price after tax is "+fp3);

break;

case 3:System.out.println("Your item is " +item3+ " The price before tax is ,"+price3+" your code is
"+code+". The tax is "+tax3+". The price after tax is "+fp3);

break;

default: System.out.println("Good rating");

break;
}

You might also like