/
SoftuniCoffeeShop
28 lines (27 loc) · 1001 Bytes
/
SoftuniCoffeeShop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoftuniCoffeeShop
{
class SoftuniCoffeeShop
{
static void Main(string[] args)
{
int Count = int.Parse(Console.ReadLine());
decimal sum = 0;
for (int i = 0; i < Count; i++)
{
decimal pricePerCapsule = decimal.Parse(Console.ReadLine());
DateTime daysInMonth = DateTime.ParseExact(Console.ReadLine(), "d/M/yyyy", CultureInfo.InvariantCulture);
int capsulesCount = int.Parse(Console.ReadLine());
decimal orderPrice = DateTime.DaysInMonth(daysInMonth.Year, daysInMonth.Month) * capsulesCount * pricePerCapsule;
sum += orderPrice;
Console.WriteLine($"The price for the coffee is: ${orderPrice:F2}");
}
Console.WriteLine($"Total: ${sum:F2}");
}
}
}