java program A cloth showroom has announced festival discounts and the gifts on the purchase of items,based on the total cost given below: total cost discount gift up to Rs 2000 5% calculator Rs 2001 to 5000 10% school bag Rs 5001 to 10000 15% wall clock Above than Rs 10000 20% wrist watch member methods: void input()-to input the total cost void calculate()-compute and display the amount to be paid by the customer along with the gift. write a main() method and call the above methods.
Answers
Answered by
38
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);
}
}
Please mark as brainliest
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);
}
}
Please mark as brainliest
Answered by
6
Explanation:
this is the answer. trust me
Attachments:
Similar questions