Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigDecimal;
- import java.util.Scanner;
- public class Vacation {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int number = Integer.parseInt(scanner.nextLine());
- String typeOfGroup = scanner.nextLine();
- String dayOfWeek = scanner.nextLine();
- BigDecimal pricePerson = new BigDecimal("0");
- BigDecimal totalPrice = new BigDecimal("0");
- if (typeOfGroup == "Students") {
- if (dayOfWeek == "Friday")
- pricePerson = new BigDecimal(8.45);
- if (dayOfWeek == "Saturday")
- pricePerson = new BigDecimal(9.80);
- if (dayOfWeek == "Sunday")
- pricePerson = new BigDecimal(10.46);
- }
- else (typeOfGroup == "Business") {
- if (dayOfWeek == "Friday")
- pricePerson = new BigDecimal(10.90);
- if (dayOfWeek == "Saturday")
- pricePerson = new BigDecimal(15.60);
- if (dayOfWeek == "Sunday")
- pricePerson = new BigDecimal(16);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement