Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int count = Integer.parseInt(scanner.nextLine());
- String size = scanner.nextLine(),
- delivery = scanner.nextLine();
- double price = 0, discountPercentage = 0, totalPrice;
- if (count <= 10) {
- System.out.println("Invalid order");
- } else {
- if (size.equals("90X130")) {
- price = 110;
- if (count > 60) {
- discountPercentage = 8;
- } else if (count > 30) {
- discountPercentage = 5;
- }
- } else if (size.equals("100X150")) {
- price = 140;
- if (count > 80) {
- discountPercentage = 10;
- } else if (count > 40) {
- discountPercentage = 6;
- }
- } else if (size.equals("130X180")) {
- price = 190;
- if (count > 50) {
- discountPercentage = 12;
- } else if (count > 20) {
- discountPercentage = 7;
- }
- } else if (size.equals("200X300")) {
- price = 250;
- if (count > 50) {
- discountPercentage = 14;
- } else if (count > 25) {
- discountPercentage = 9;
- }
- }
- totalPrice = price * count * ((100 - discountPercentage) / 100);
- if (delivery.equals("With delivery")) {
- totalPrice += 60;
- }
- if (count > 99) {
- totalPrice *= 0.96;
- }
- System.out.printf("%.2f BGN\n", totalPrice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement