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 scan = new Scanner(System.in);
- String destination = scan.nextLine();
- while (!destination.equals("End")) {
- double minimumBudget = Double.parseDouble(scan.nextLine());
- double budget = 0;
- while (budget < minimumBudget) {
- double money = Double.parseDouble(scan.nextLine());
- budget += money;
- }
- System.out.printf("Going to %s!%n", destination);
- destination = scan.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment