Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Voyage {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- System.out.print("Enter sum: ");
- double budget = keyboard.nextDouble();
- System.out.print("Enter season - summer or winter: ");
- String season = keyboard.next();
- if (budget <= 100) {
- if (season.equals("summer")) {
- System.out.printf("Somewhere in Bulgaria %nCamp - %.2f lv.", budget * 0.3);
- } else {
- System.out.printf("Somewhere in Bulgaria %nHotel - %.2f lv.", budget * 0.7);
- }
- } else if (100 < budget && budget <= 1000) {
- if (season.equals("sommer")) {
- System.out.printf("Somewhere in Balkans %nCamp - %.2f lv.", budget * 0.4);
- } else {
- System.out.printf("Somewhere in Balkans %nHotel - %.2f lv.", budget * 0.8);
- }
- } else {
- System.out.printf("Somewhere in Europa %nHotel - %.2f lv.", budget * 0.9);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement