Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- //((daysInMonth * capsulesCount) * pricePerCapsule)
- int countOfOrder = int.Parse(Console.ReadLine());
- decimal total = 0;
- for (int order = 0; order < countOfOrder; order++)
- {
- decimal pricePerCapsule = decimal.Parse(Console.ReadLine());
- var orderDate = Console.ReadLine();
- var date = DateTime.ParseExact(orderDate, "d/M/yyyy", CultureInfo.InvariantCulture);
- int days = DateTime.DaysInMonth(date.Year, date.Month);
- long capsulesCount = long.Parse(Console.ReadLine());
- var orderPrice = days*capsulesCount*pricePerCapsule;
- Console.WriteLine("The price for the coffee is: ${0:F2}", orderPrice);
- total += orderPrice;
- }
- Console.WriteLine("Total: ${0:F2}",total);
- //Console.WriteLine(orderPrice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement