Computer Science, asked by dynamothunder43, 1 year ago

Design a class program in java to calculate the discount given to a customer on purchasing LED television . the program also displays the amount paid by the customer after discount . The details are given as: <br />class name : television<br />Data members:int cost,int discount,int amount <br />Accept ():to input the cost of television <br />Calculate the discount <br />Display():to show the discount and the amount paid after discount<br /><br />​

Answers

Answered by Ranauk456
5

class Discount

{

public static void main(String args[])

{

 

double  dis,amount,markedprice,s;

               

markedprice=Double.parseDouble(args[0]);

                 

       dis=Double.parseDouble(args[1]);                            

 

System.out.println("markedprice= "+markedprice);

 

System.out.println("discount rate="+dis);

         

       s=100-dis;

 

amount= (s*markedprice)/100;

 

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

 

}

}

[Same question answer, I am doing for 2 times haha]

Similar questions