07. HotelRoom
Здравейте, въпросът ми е защо в Judge ми дава 90/100 ?
https://pastebin.com/YcJBDx1Z
import java.util.Scanner;
public class HotelRoom {
public static void main(String arg[]){
Scanner scanner = new Scanner(System.in);
String month = scanner.nextLine();
int nights = Integer.parseInt(scanner.nextLine());
double studioPrice = 0;
double apartmentPrice = 0;
double discountStudio = 0;
double discountApatment = 0;
if ("May".equals(month) || "October".equals(month)) {
studioPrice = 50;
apartmentPrice = 65;
if ( nights > 7 && nights < 14 ) {
discountStudio = studioPrice * 0.05;
}
else if ( nights > 14 ) {
discountStudio = studioPrice * 0.3;
discountApatment = apartmentPrice * 0.1;
}
}
else if ("June".equals(month) || "September ".equals(month)) {
studioPrice = 75.20;
apartmentPrice = 68.70;
if (nights > 14) {
discountStudio = studioPrice * 0.2;
discountApatment = apartmentPrice * 0.1;
}
}
else if ("July".equals(month) || "August".equals(month)) {
studioPrice = 76;
apartmentPrice = 77;
if (nights > 14) {
discountApatment = apartmentPrice * 0.1;
}
}
double priceTotalStudio = (studioPrice - discountStudio) * nights;
double priceTotalApartment = (apartmentPrice - discountApatment) * nights;
System.out.printf("Apartment: %.2f lv.", priceTotalApartment);
System.out.println("");
System.out.printf("Studio: %.2f lv.", priceTotalStudio);
}
}
Благодаря!