Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package TestApril14_15;
- import java.util.Scanner;
- public class Aluminium {
- public static void main(String[] agrs) {
- Scanner scanner = new Scanner(System.in);
- int joineryCount = Integer.parseInt(scanner.nextLine());
- String joineryType = scanner.nextLine();
- String delivery = scanner.nextLine();
- double price = 0;
- if (joineryCount < 10) {
- System.out.println("Invalid order");
- return;
- }
- if (joineryType.equals("90X130")) {
- price = 110;
- price *= joineryCount;
- if (joineryCount > 60) {
- price *= 0.92;
- } else if (joineryCount > 30) {
- price *= 0.95;
- }
- } else if (joineryType.equals("100X150")) {
- price = 140;
- price *= joineryCount;
- if (joineryCount > 80) {
- price *= 0.90;
- } else if (joineryCount > 40) {
- price *= 0.94;
- }
- } else if (joineryType.equals("130X180")) {
- price = 190;
- price *= joineryCount;
- if (joineryCount > 50) {
- price *= 0.88;
- } else if (joineryCount > 20) {
- price *= 0.93;
- }
- } else if (joineryType.equals("200X300")) {
- price = 250;
- price *= joineryCount;
- if (joineryCount > 50) {
- price *= 0.86;
- } else if (joineryCount > 25) {
- price *= 0.91;
- }
- }
- if (delivery.equals("With delivery")) {
- price += 60;
- }
- if (joineryCount >= 100) {
- price *= 0.96;
- }
- System.out.printf("%.2f BGN", price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement