Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine()),
- fuel = Double.parseDouble(scanner.nextLine()),
- sum = 2.10 * fuel + 100;
- String day = scanner.nextLine();
- if (day.equals("Saturday")) {
- sum *= 0.90;
- } else {
- sum *= 0.80;
- }
- if (budget >= sum) {
- System.out.printf("Safari time! Money left: %.2f lv.\n", budget - sum);
- } else {
- System.out.printf("Not enough money! Money needed: %.2f lv.\n", sum - budget);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement