Advertisement
viraco4a

04. Beverage Labels

May 22nd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 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 test_1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string Name = Console.ReadLine();
  14. int Volume = int.Parse(Console.ReadLine());
  15. int Energy = int.Parse(Console.ReadLine());
  16. int Sugar = int.Parse(Console.ReadLine());
  17.  
  18. double TotalEnergy = (Volume / 100.0) * Energy;
  19. double TotalSugar = (Volume / 100.0) * Sugar;
  20. Console.WriteLine($"{Volume}ml {Name}:");
  21. Console.WriteLine($"{TotalEnergy}kcal, {TotalSugar}g sugars");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement