Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package practice.programpractice;
- //1.0.3
- import java.util.*;
- public class priceAndQuantity {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Enter the QTY: ");
- double qty = sc.nextInt();
- System.out.println("Enter the PR: ");
- double pr = sc.nextInt();
- double bill = qty * pr;
- //System.out.println(bill);
- if (bill >= 5000) {
- double discount = bill * 0.25;
- double totalBill = bill - discount;
- System.out.println("You saved " + discount + "\nfrom " + bill + " original price\n\nThe Total Bill amount is " + totalBill);
- }
- else
- System.out.println("The total bill amount is " + bill);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement