Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class PrintingPlace {
  4.    
  5.     public static void main(String[] args) {
  6.        
  7.         Scanner kb = new Scanner(System.in);
  8.         int copies = kb.nextInt();
  9.         double price = 0, totalPrice = 0;
  10.        
  11.         if (copies >= 0 && copies <= 400) {
  12.             price = 0.08;  
  13.         } else if (copies >= 500 && copies <= 749) {
  14.             price = 0.05;
  15.         } else if (copies >= 750 && copies <= 999) {
  16.             price = 0.03;
  17.         } else if (copies >= 1000) {
  18.             price = 0.025;
  19.         }
  20.        
  21.         totalPrice = copies * price;
  22.        
  23.         System.out.printf("Price per copy: %.3f", price);
  24.         System.out.printf("Total price: %.3f", totalPrice);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement