Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class NewHome {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine().toLowerCase();
- Double totalPrice = 0.00;
- String typeRoom = "";
- String destination = "";
- if(budget <= 100){
- if("summer".equals(season)){
- totalPrice = budget * 0.30;
- }else if("winter".equals(season)){
- totalPrice = budget * 0.70;
- }
- destination = "Bulgaria";
- }else if(budget <= 1000){
- if("summer".equals(season)){
- totalPrice = budget * 0.40;
- }else if("winter".equals(season)){
- totalPrice = budget * 0.80;
- }
- destination = "Balkans";
- }else if(budget > 1000){
- totalPrice = budget * 0.90;
- destination = "Europe";
- }else{}
- if("summer".equals(season) && !destination.equals("Europe")){
- typeRoom = "Camp";
- }else{
- typeRoom = "Hotel";
- }
- System.out.printf("Somewhere in %s\n",destination);
- System.out.printf("%s - %.2f",typeRoom, totalPrice);
- }
- }
Add Comment
Please, Sign In to add comment