Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Exam_26_March_2016 - created by borkins on 2017-05-14.
- */
- import java.util.Scanner;
- public class _03_Trip
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- double budget = Double.parseDouble(console.nextLine());
- String season = console.nextLine();
- boolean isSummer = season.equalsIgnoreCase("summer");
- String destination;
- String restingPlace = isSummer ? "Camp" : "Hotel";
- double cost;
- if (budget <= 100) {
- destination = "Bulgaria";
- if (isSummer) {
- cost = 0.30;
- } else {
- cost = 0.70;
- }
- }
- else if (budget <= 1000) {
- destination = "Balkans";
- if (isSummer) {
- cost = 0.40;
- } else {
- cost = 0.80;
- }
- }
- else {
- destination = "Europe";
- restingPlace = "Hotel";
- cost = 0.90;
- }
- System.out.printf("Somewhere in %s%n%s - %.2f",
- destination, restingPlace, (budget * cost));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment