Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class main4 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. String typeRace = scanner.nextLine();
  8. String typeCoupon = scanner.nextLine();
  9. int couponCount = Integer.parseInt(scanner.nextLine());
  10. boolean freeImage = false;
  11. String trophy = scanner.nextLine();
  12.  
  13. double priceCoupon = 0;
  14.  
  15.  
  16. if (typeRace.equalsIgnoreCase("Quarter final") && typeCoupon.equalsIgnoreCase("Standard")) {
  17. priceCoupon = 55.50 * couponCount;
  18. } else if (typeRace.equalsIgnoreCase("Quarter final") && typeCoupon.equalsIgnoreCase("Premium")) {
  19. priceCoupon = 105.20 * couponCount;
  20. } else if (typeRace.equalsIgnoreCase("Quarter final") && typeCoupon.equalsIgnoreCase("VIP")) {
  21. priceCoupon = 118.90 * couponCount;
  22. }
  23. if (typeRace.equalsIgnoreCase("Semi final") && typeCoupon.equalsIgnoreCase("Standard")) {
  24. priceCoupon = 75.88 * couponCount;
  25. } else if (typeRace.equalsIgnoreCase("Semi final") && typeCoupon.equalsIgnoreCase("Premium")) {
  26. priceCoupon = 125.22 * couponCount;
  27. } else if (typeRace.equalsIgnoreCase("Semi final") && typeCoupon.equalsIgnoreCase("VIP")) {
  28. priceCoupon = 300.40 * couponCount;
  29. }
  30. if (typeRace.equalsIgnoreCase("Final") && typeCoupon.equalsIgnoreCase("Standard")) {
  31. priceCoupon = 110.10 * couponCount;
  32. } else if (typeRace.equalsIgnoreCase("Final") && typeCoupon.equalsIgnoreCase("Premium")) {
  33. priceCoupon = 160.66 * couponCount;
  34. } else if (typeRace.equalsIgnoreCase("Final") && typeCoupon.equalsIgnoreCase("VIP")) {
  35. priceCoupon = 400 * couponCount;
  36. }
  37.  
  38. if (priceCoupon > 4000) {
  39. priceCoupon = priceCoupon - 0.25 * priceCoupon;
  40. freeImage = true;
  41. }
  42. else if (priceCoupon > 2500) {
  43. priceCoupon = priceCoupon - 0.1 * priceCoupon;
  44. }
  45.  
  46. if (trophy.equalsIgnoreCase("Y") && !freeImage){
  47. priceCoupon += 40 * couponCount;
  48. }
  49.  
  50. System.out.printf("%.2f",priceCoupon);
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement