Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pb1;
- import java.util.Scanner;
- public class FreeNedelq {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int pictures = Integer.parseInt(scanner.nextLine());
- String picturesType = scanner.next();
- String purchase = scanner.nextLine();
- double priceForOne = 0.0;
- double wholePrice = 0.0;
- double sale = 0.0;
- if (purchase.equals("online")) {
- if (picturesType.equals("9X13") && pictures >= 50) {
- priceForOne = 0.16;
- sale = 0.02;
- wholePrice = (priceForOne * pictures) * 0.95;
- } else if (picturesType.equals("10X15") && pictures >= 80) {
- priceForOne = 0.16;
- wholePrice = (priceForOne * pictures) * 0.97;
- } else if (picturesType.equals("13X18") && pictures >= 100) {
- priceForOne = 0.38;
- wholePrice = (priceForOne * pictures) * 0.95;
- } else if (picturesType.equals("13X18") && pictures >= 50 && pictures <= 100) {
- priceForOne = 0.38;
- wholePrice = (priceForOne * pictures) * 0.97;
- } else if (picturesType.equals("20X10") && pictures > 50) {
- priceForOne = 2.90;
- wholePrice = (priceForOne * pictures) * 0.91;
- } else if (picturesType.equals("20X10") && pictures >= 10 && pictures <= 50) {
- priceForOne = 2.90;
- wholePrice = (priceForOne * pictures) * 0.93;
- }
- }
- if (purchase.equals("offline")) {
- if (picturesType.equals("9X13") && pictures >= 50) {
- priceForOne = 0.16;
- sale = 1;
- wholePrice = (priceForOne * pictures) * 0.95;
- } else if (picturesType.equals("10X15") && pictures >= 80) {
- priceForOne = 0.16;
- wholePrice = (priceForOne * pictures) * 0.97;
- } else if (picturesType.equals("13X18") && pictures >= 50 && pictures <= 100) {
- priceForOne = 0.38;
- wholePrice = (priceForOne * pictures) * 0.97;
- } else if (picturesType.equals("20X10") && pictures >= 10 && pictures <= 50) {
- priceForOne = 2.90;
- wholePrice = (priceForOne * pictures) * 0.93;
- } else if (picturesType.equals("20X10") && pictures > 50) {
- priceForOne = 2.90;
- wholePrice = (priceForOne * pictures) * 0.91;
- } else if (picturesType.equals("13X18") && pictures >= 100) {
- priceForOne = 0.38;
- wholePrice = (priceForOne * pictures) * 0.95;
- }
- }
- double result = wholePrice * sale;
- System.out.printf("%.2fBGN", result );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement