Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. import java.math.BigDecimal;
  2. import java.util.Scanner;
  3.  
  4. public class Vacation {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. int number = Integer.parseInt(scanner.nextLine());
  9. String typeOfGroup = scanner.nextLine();
  10. String dayOfWeek = scanner.nextLine();
  11. BigDecimal pricePerson = new BigDecimal("0");
  12. BigDecimal totalPrice = new BigDecimal("0");
  13.  
  14. if (typeOfGroup == "Students") {
  15. if (dayOfWeek == "Friday")
  16. pricePerson = new BigDecimal(8.45);
  17. if (dayOfWeek == "Saturday")
  18. pricePerson = new BigDecimal(9.80);
  19. if (dayOfWeek == "Sunday")
  20. pricePerson = new BigDecimal(10.46);
  21. }
  22. else (typeOfGroup == "Business") {
  23. if (dayOfWeek == "Friday")
  24. pricePerson = new BigDecimal(10.90);
  25. if (dayOfWeek == "Saturday")
  26. pricePerson = new BigDecimal(15.60);
  27. if (dayOfWeek == "Sunday")
  28. pricePerson = new BigDecimal(16);
  29. }
  30.  
  31.  
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement