Computer Science, asked by sristi9, 9 months ago

A cloth showroom has announced festival discount and the gifts on the purchase of items based on the total cost As given below
upto rupees 2000, 5% discount ,gift is calculator
from rupees 2000 to rupees 5000, 10% discount, gift school bag
from rupees 5000 to rupees 10,000, the discount is 15% and the gift is wall clock
above rupees 10000 ,discount is 20%,gift is wrist watch
Write a program to input total cost. Compute and display the amount to be paid by the customer along with the gift
Pls solve using scanner class and conditional statements ​

Answers

Answered by singhbob2018
76

Hope it helps

Mark as brainiest

Attachments:
Answered by TaehyungsCuteGirl
97

Answer:

import java.util.*;

public class Cloth_Showroom

{

public static void main(String args[ ])

{

Scanner sc = new Scanner(System.in);

double d= 0, amt= 0, tp= 0;

String g;

System.out.println("Enter the total cost");

tp= sc.nextDouble();

if(tp<=2000)

{

d= 5;

g= "Calculator";

}

if(tp<=5000 && tp>2000)

{

d= 10;

g= "School Bag";

}

if(tp<=10000 && tp>5000)

{

d= 15;

g= "Wall Clock";

}

if(tp>10000)

{

d= 20;

g= "Wrist Watch";

}

amt= tp-d;

System.out.println("Amount to be paid= " +amt);

System.out.println("Gift= " +g);

}

}

Similar questions