Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package L03_ConditionalStatementsAdvanced;
- import java.util.Scanner;
- public class P09_SkiTrip {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int days = Integer.parseInt(scanner.nextLine());
- String roomType = scanner.nextLine();
- String assessment = scanner.nextLine();
- int nights = days - 1;
- double price = 0;
- switch (roomType){
- case "room for one person":
- price = nights * 18;
- break;
- case "apartment":
- price = nights * 25;
- if(nights < 10){
- price = price * 0.7;
- } else if (nights <= 15) {
- price = price * 0.65;
- }else {
- price = price * 0.5;
- }
- break;
- case "president apartment":
- //todo
- break;
- }
- if (assessment.equals("positive")){
- //todo
- }else if (assessment.equals("negative")){
- //todo
- }
- System.out.printf("%.2f", price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment