Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ivan;
- import java.util.Scanner;
- public class _03_Megapixels {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int countFotos = Integer.parseInt(console.nextLine());
- String type = console.nextLine();
- String typeOfOrder = console.nextLine();
- double onePeicePrize = 0;
- double countDiscount = 1;
- switch (type) {
- case "9X13":
- onePeicePrize = 0.16;
- if (countFotos >= 50) {
- countDiscount = 0.95;
- }
- break;
- case "10X15":
- onePeicePrize = 0.16;
- if (countFotos >= 80) {
- countDiscount = 0.97;
- }
- break;
- case "13X18":
- onePeicePrize = 0.38;
- if (countFotos >= 50 && countFotos <= 100) {
- countDiscount = 0.97;
- } else if (countFotos > 100) {
- countDiscount = 0.95;
- }
- break;
- case "20X30":
- onePeicePrize = 2.90;
- if (countFotos >= 10 && countFotos <= 50) {
- countDiscount = 0.93;
- } else if (countFotos > 50) {
- countDiscount = 0.91;
- }
- break;
- }
- double sum = countFotos * onePeicePrize * countDiscount;
- if (typeOfOrder.equals("online")) {
- sum *= 0.98;
- }
- System.out.printf("%.2fBGN", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement