Advertisement
kalin729

popravitelen

Jan 7th, 2018 (edited)
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1.  var N = double.Parse(Console.ReadLine());
  2.             var Z = int.Parse(Console.ReadLine());
  3.             var F = double.Parse(Console.ReadLine());
  4.             var P = double.Parse(Console.ReadLine());
  5.  
  6.             var coming_kids = Math.Ceiling(Z*0.85);
  7.             var money_kids = Math.Floor(coming_kids*0.8);
  8.             var money_from_kids = money_kids * F;  
  9.             var money_collected = money_from_kids + N;
  10.             var cost = (coming_kids*4.5) + (P*0.05);
  11.  
  12.             var final_money = money_collected - cost;
  13.  
  14.             var scooter_money = final_money - P;
  15.  
  16.             if (final_money > P)
  17.             {
  18.                 Console.WriteLine("Asparuh will be driving a fast 49cc Scooter soon.");
  19.                 Console.WriteLine(String.Format("Money left: {0:0.00} BGN", scooter_money));
  20.             }
  21.             else {
  22.                 Console.WriteLine(String.Format("If only asparuh had {0:0.00} BGN more...", Math.Abs(scooter_money)));
  23.                 Console.WriteLine("Guess he will be walking for now.");
  24.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement