Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Travelling {
- public static void main(String[] args) {
- Scanner myScan = new Scanner(System.in);
- String destination = myScan.nextLine();
- while (!destination.equals("End")) {
- double savedMoney = 0;
- double minBudged = Double.parseDouble(myScan.nextLine());
- while (minBudged > savedMoney) {
- double incoming = Double.parseDouble(myScan.nextLine());
- savedMoney += incoming;
- }
- System.out.printf("Going to %s!%n", destination);
- savedMoney = 0;
- destination = myScan.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement