Advertisement
Guest User

budget

a guest
Feb 18th, 2020
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Travelling
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string destination = Console.ReadLine();
  10.             double budget = 0.0;
  11.             double savedMoney = 0.0;
  12.  
  13.             while (destination != "End")
  14.             {
  15.                 budget = double.Parse(Console.ReadLine());
  16.                
  17.                 while (budget > 0)
  18.                 {
  19.                     savedMoney = double.Parse(Console.ReadLine());
  20.                     budget -= savedMoney;
  21.                 }
  22.                 Console.WriteLine($"Going to {destination}!");
  23.                 destination = Console.ReadLine();
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement