Advertisements
Advertisements
Question
Design a 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:
Class name: Television
Data members: int cost, int discount, int amount
Member methods:
Accept(): to input the cost of Television
Calculate(): to calculate the discount
Display(): to show the discount and the amount paid after discount
Answer in Brief
Solution
public class Television{
int cost, discount, amount;
public void Accept()
{
}
public void Calculate()
{
}
public void Display()
{
}}
shaalaa.com
Is there an error in this question or solution?
Chapter 1.02: Elementary Concept of Objects and Classes - EXERCISES [Page 17]