Проблем със задача SKI TRIP. Разминаване в крайния резултат
import java.util.Scanner;
public class SkiTripp {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = Integer.parseInt(scanner.nextLine());
String typeRoom = scanner.nextLine();
String mark = scanner.nextLine();
int nights = days - 1;
double totalPrice = 0;
switch (typeRoom) {
case "room for one person" :
totalPrice = nights * 18.00 ;
break;
case "apartment" :
totalPrice = nights * 25.00;
if (nights < 10) {
totalPrice = totalPrice * 0.7;
}else if (nights >= 10 && 15 <= nights){
totalPrice = totalPrice * 0.65;
}else if (nights > 15) {
totalPrice = totalPrice * 0.5 ;
} break;
case "president apartment" :
totalPrice = nights * 35.00;
if (nights < 10) {
totalPrice = totalPrice * 0.9;
}else if (nights >= 10 && 15 <= nights){
totalPrice = totalPrice * 0.85;
}else if (nights > 15) {
totalPrice = totalPrice * 0.8 ;
}break;
}
if (mark.equals("positive")) {
totalPrice = totalPrice + (totalPrice * 0.25);
}else if(mark.equals(negative")) {
totalPrice = totalPrice - (totalPrice * 0.1);
}
System.out.printf("%.2f", totalPrice);
}
}