Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Globalization;
- namespace _11.Order
- {
- class Program
- {
- static void Main(string[] args)
- {
- int order = Int32.Parse(Console.ReadLine());
- double priceCapsule;
- int days;
- int count;
- double sum;
- double total = 0;
- string result;
- for (int i = 0; i < order; i++)
- {
- priceCapsule = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- days = Int32.Parse(Console.ReadLine());
- count = Int32.Parse(Console.ReadLine());
- sum = ((days * count) * priceCapsule);
- total += sum;
- result = sum.ToString("C", new CultureInfo("en-US"));
- Console.WriteLine($"The price for the coffee is: ${sum, 0:N2}");
- }
- result = total.ToString("C", new CultureInfo("en-US"));
- Console.WriteLine($"Total: ${total, 0:N2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement