BubaLazi

4.Beverage Labels

May 27th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 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 _01.BasicSyntaxDemo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var name = Console.ReadLine();
  14.             double volume = int.Parse(Console.ReadLine());
  15.             double energyBasic = int.Parse(Console.ReadLine());
  16.             var sugarBasic = int.Parse(Console.ReadLine());
  17.             double energy = energyBasic * ( volume / 100);
  18.             double sugar = sugarBasic * ( volume / 100);
  19.             Console.WriteLine("{0}ml {1}", volume, name);
  20.             Console.WriteLine("{0}kcal, {1}g sugars", energy, sugar);
  21.  
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment