Computer Science, asked by Niraja2597, 1 year ago

Wap to input unit price and quantity purchase of an item. Calculate the total cost and discount as 10 percent on total cost. Print the net amount to be paid by a customer

Answers

Answered by gurukulamdivya
2

Answer:

class Discount

{

public static void main(String args[])

{

double  dis=10,amount,qnt,markedprice,s,Totalcost;

Scanner sc=new Scanner(System.in);

System.out.println("enter markedprice ");    

markedprice=sc.nextDouble();

       System.out.println("Enter the Quantity");    

qnt=sc.nextDouble();

       Totalcost=markedprice  * qnt;

       s=100-dis;

amount= (s*Totalcost)/100;

System.out.println("amount after discount="+amount);

}

}

Similar questions