Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class PrintingPlace {
- public static void main(String[] args) {
- Scanner kb = new Scanner(System.in);
- int copies = kb.nextInt();
- double price = 0, totalPrice = 0;
- if (copies >= 0 && copies <= 400) {
- price = 0.08;
- } else if (copies >= 500 && copies <= 749) {
- price = 0.05;
- } else if (copies >= 750 && copies <= 999) {
- price = 0.03;
- } else if (copies >= 1000) {
- price = 0.025;
- }
- totalPrice = copies * price;
- System.out.printf("Price per copy: %.3f", price);
- System.out.printf("Total price: %.3f", totalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement