Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Beverage_Labels
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name = Console.ReadLine();
- int volume = int.Parse(Console.ReadLine());
- int energy = int.Parse(Console.ReadLine());
- int sugar = int.Parse(Console.ReadLine());
- double energyTotal = (double)(energy) * volume / 100;
- double sugarTotal = (double)(sugar) * volume / 100;
- Console.WriteLine($"{volume}ml {name}:");
- Console.WriteLine($"{energyTotal}kcal, {sugarTotal}g sugars");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment