Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Vacation {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String destination = scanner.nextLine();
- while (!destination.equals("End")) {
- double price = Double.parseDouble(scanner.nextLine());
- double savings = 0;
- while (savings < price){
- savings += Double.parseDouble(scanner.nextLine());
- }
- System.out.println("Going to " + destination + "!");
- destination = scanner.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement