Home / Questions / 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 : TelevisionData members: int cost, int discount, int amountMember functions:Accept( ) : to input the cost of TelevisionCalculate( ) : to calculate the discountDisplay( ) : to show the discount and the amount paid after discount
Explanatory 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 functions:
Accept( ) : to input the cost of Television
Calculate( ) : to calculate the discount
Display( ) : to show the discount and the amount paid after discount

👁 120 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation


class Television {
    int cost;
    int discount;
    int amount;

    void Accept() {
        /*
         * Input the cost
         * of Television
         */
    }

    void Calculate() {
        /*
         * Calculate the discount
         */
    }

    void Display() {
        /*
         * Show the discount and
         * the amount paid
         * after discount
         */
    }
}