Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int count = Integer.parseInt(scanner.nextLine());
- String type = scanner.nextLine();
- String payment = scanner.nextLine();
- double price = 0;
- if(type.equals("9X13")){
- price = count * 0.16;
- if(count >= 50){
- price = price - (price * 0.05); // price * 0.95
- }
- }else if(type.equals("10X15")){
- price = count * 0.16;
- if(count >= 80){
- price = price - (price * 0.03); // price * 0.95
- }
- }else if(type.equals("13X18")){
- price = count * 0.38;
- if(count >= 50 && count<= 100){
- price = price - (price * 0.03); // price * 0.95
- }else if(count > 100){
- price = price - (price * 0.05); // price * 0.95
- }
- }else if(type.equals("20X30")){
- price = count * 2.90;
- if(count >= 10 && count<= 50){
- price = price - (price * 0.07); // price * 0.95
- }else if(count > 50){
- price = price - (price * 0.09); // price * 0.95
- }
- }
- if(payment.equals("online")){
- price = price - (price * 0.02);
- }
- System.out.printf("%.2fBGN", price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement