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
Answers
Answered by
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);
}
Similar questions
Computer Science,
7 months ago
Science,
7 months ago
English,
7 months ago
Political Science,
1 year ago
Math,
1 year ago
Computer Science,
1 year ago