Computer Science, asked by kanika091, 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:
class name : television
Data members:int cost,int discount,int amount
Accept ():to input the cost of television
Calculate the discount
Display():to show the discount and the amount paid after discount


jainaditya0411: I can answer in C
kanika091: but i need it in java
jainaditya0411: Ok but what is discount %
jainaditya0411: or should I keep it according to myself?
kanika091: yed

Answers

Answered by jainaditya0411
3

#include <stdio.h>

void main()

{

    int cost,discount,amount;

    printf("pls enter the cost price\n");

    scanf("%d",&cost);

    discount = cost*10/100;

 amount = cost - discount;

    printf("\n discount is rs %d \n The amount to be paid is rs %d",discount,amount);

}


jainaditya0411: I don't know Java so I gave answer in C
kanika091: its ok
kanika091: thanks
jainaditya0411: pls mark me brainliest
Similar questions