Advertisement
Valantina

LemonadeStand/EX 27072019

Jul 29th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P01_LemonadeStand
  4. {
  5.     class P01_LemonadeStand
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double lemonKg = double.Parse(Console.ReadLine());
  10.             double sugarKg = double.Parse(Console.ReadLine());
  11.             double water = double.Parse(Console.ReadLine()) * 1000;
  12.  
  13.             double lemonJuice = lemonKg * 980;
  14.             double lemonade = lemonJuice + water;
  15.             lemonade += sugarKg * 0.3;
  16.  
  17.             double cups = Math.Floor(lemonade / 150);
  18.             double finalPrice = cups * 1.2;
  19.  
  20.             Console.WriteLine($"All cups sold: {cups}");
  21.             Console.WriteLine($"Money earned: {finalPrice:F2}");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement