Advertisement
Spocoman

11. Orders

Jan 13th, 2022
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Orders
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             double totalPrice = 0;
  11.  
  12.             for (int i = 0; i < n; i++)
  13.             {
  14.                 double capsulePrice = double.Parse(Console.ReadLine());
  15.                 int days = int.Parse(Console.ReadLine());
  16.                 int capsuleCount = int.Parse(Console.ReadLine());
  17.  
  18.                 double price = capsulePrice * capsuleCount * days;
  19.                 totalPrice += price;
  20.                 Console.WriteLine($"The price for the coffee is: ${price:F2}");
  21.             }
  22.             Console.WriteLine($"Total: ${totalPrice:F2}");
  23.         }
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement