Advertisement
VelizarAvramov

04. Beverage Labels

Nov 3rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04._Beverage_Labels
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string productName = Console.ReadLine();
  10.             double volume = double.Parse(Console.ReadLine());
  11.             double energyPer100ml = double.Parse(Console.ReadLine());
  12.             double sugarPer100ml = double.Parse(Console.ReadLine());
  13.  
  14.             Console.WriteLine($"{volume}ml {productName}:");
  15.  
  16.             double kcal = volume * energyPer100ml / 100;
  17.             double sugars = volume * sugarPer100ml /100;
  18.  
  19.             Console.WriteLine($"{kcal}kcal, {sugars}g sugars");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement