Advertisement
Ivakis

Photo Pictures

Oct 10th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int count = Integer.parseInt(scanner.nextLine());
  8. String type = scanner.nextLine();
  9. String payment = scanner.nextLine();
  10.  
  11. double price = 0;
  12.  
  13. if(type.equals("9X13")){
  14. price = count * 0.16;
  15. if(count >= 50){
  16. price = price - (price * 0.05); // price * 0.95
  17. }
  18. }else if(type.equals("10X15")){
  19. price = count * 0.16;
  20. if(count >= 80){
  21. price = price - (price * 0.03); // price * 0.95
  22. }
  23. }else if(type.equals("13X18")){
  24. price = count * 0.38;
  25. if(count >= 50 && count<= 100){
  26. price = price - (price * 0.03); // price * 0.95
  27. }else if(count > 100){
  28. price = price - (price * 0.05); // price * 0.95
  29. }
  30. }else if(type.equals("20X30")){
  31. price = count * 2.90;
  32. if(count >= 10 && count<= 50){
  33. price = price - (price * 0.07); // price * 0.95
  34. }else if(count > 50){
  35. price = price - (price * 0.09); // price * 0.95
  36. }
  37. }
  38. if(payment.equals("online")){
  39. price = price - (price * 0.02);
  40. }
  41.  
  42. System.out.printf("%.2fBGN", price);
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement