OneCompiler

Book

1634

class book
{
public static void main(String book, double price)
{
double discount;
double amount;

    System.out.println("Name of the book: " + book);
    System.out.println("Price of the book: " + price);
    
    if (price <=1000)
    {
    discount = price * 2/100;
}
else if (price >1000 && price <=3000)
{
    discount = price * 10/100;
}
else{
    discount = price * 15/100;
}
   amount = price - discount;
   System.out.println("Amount = "+amount); 
}

}