Computer Science, asked by Raunak3456, 1 day ago

A shopping mall is celebrating annual MEGA SALE during which they are offering discounts on the total purchase amount based on the following criteria
AMOUNT DISCOUNT UPTO Rs.1000 5%
1001 to 2500 10%
2501 to 5000 12%
Greater than Rs.5000 15%
Write a program to assign the amount and display the discount and net price after availing the discount.​

Answers

Answered by cspr0292201920
0

Answer:

zo do do so d4d8s93fiditzyryzu so is well of web of th we did ek

Answered by shilpa85475
0

Explanation:

import java.io.*;

public class Discountoffers

{

   public static void main(String args[]) throws IOException {

       

       InputStreamReader read = new InputStreamReader(System.in);

       BufferedReader in = new BufferedReader(read);

       

       System.out.print("Enter customer name: ");

       String name = in.readLine();

       

       System.out.print("Enter total cost: ");

       double count = Double.parseDouble(in.readLine());

       

       int discount = 0;

       

       if (count <= 1000)

           discount = 5;

       else if (count <= 2500)

           discount = 10;

       else if (count <= 5000)

           discount = 15;

       else

           discount = 20;

           

       double disc = count * d / 100.0;

       double amt = count - disc;

       

       System.out.println("Customer Name: " + name);

       System.out.println("Discount: " + disc);

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

   }

}

Similar questions