Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03._Vacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int groupCount = int.Parse(Console.ReadLine());
- var groupType = Console.ReadLine();
- var dayOfWeek = Console.ReadLine();
- double singlePrice = 0;
- double totalprice = 0;
- if (groupType == "Students")
- {
- if (dayOfWeek == "Friday")
- {
- singlePrice = 8.45;
- }
- else if (dayOfWeek == "Saturday")
- {
- singlePrice = 9.80;
- }
- else if (dayOfWeek == "Sunday")
- {
- singlePrice = 10.46;
- }
- if (groupCount >= 30)
- {
- totalprice = groupCount * singlePrice * 0.85;
- }
- else
- {
- totalprice = singlePrice * groupCount;
- }
- }
- else if (groupType == "Business")
- {
- if (dayOfWeek == "Friday")
- {
- singlePrice = 10.90;
- }
- else if (dayOfWeek == "Saturday")
- {
- singlePrice = 15.60;
- }
- else if (dayOfWeek == "Sunday")
- {
- singlePrice = 16.00;
- }
- if (groupCount >= 100)
- {
- totalprice = (groupCount - 10) * singlePrice;
- }
- else
- {
- totalprice = groupCount * singlePrice;
- }
- }
- else if (groupType == "Regular")
- {
- if (dayOfWeek == "Friday")
- {
- singlePrice = 15.00;
- }
- else if (dayOfWeek == "Saturday")
- {
- singlePrice = 20.00;
- }
- else if (dayOfWeek == "Sunday")
- {
- singlePrice = 22.50;
- }
- if (groupCount >= 10 && groupCount <= 20 )
- {
- totalprice = groupCount * singlePrice * 0.95;
- }
- else
- {
- totalprice = groupCount * singlePrice;
- }
- }
- Console.WriteLine($"Total price: {totalprice:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement