Advertisement
YavorGrancharov

Beverage_Labels

May 24th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Beverage_Labels
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var name = Console.ReadLine();
  14.             var volume = int.Parse(Console.ReadLine());
  15.             var energyContent = int.Parse(Console.ReadLine());
  16.             var sugarContent = int.Parse(Console.ReadLine());
  17.  
  18.             var realEnergyContent = (double)(energyContent * volume) / 100;
  19.             var realSugarContent = (double)(sugarContent * volume) / 100;
  20.            
  21.             Console.WriteLine($"{volume}" + "ml " + $"{name}" + ":");
  22.             Console.WriteLine($"{realEnergyContent}" + "kcal, " + $"{realSugarContent}" + "g sugars");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement