Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _3_Vacation_2._0
- {
- class Program
- {
- static void Main(string[] args)
- {
- int groupCount = int.Parse(Console.ReadLine());
- string groupType = Console.ReadLine();
- string dayOfWeek = Console.ReadLine();
- decimal singularPrice = 0;
- decimal totalPrice = 0;
- if (groupType == "Students")
- {
- if (dayOfWeek == "Friday")
- {
- singularPrice = 8.45m;
- }
- else if (dayOfWeek == "Saturday")
- {
- singularPrice = 9.80m;
- }
- else if (dayOfWeek == "Sunday")
- {
- singularPrice = 10.46m;
- }
- if (groupCount >= 30)
- {
- totalPrice = (singularPrice * groupCount) * 85 / 100;
- }
- else
- {
- totalPrice = singularPrice * groupCount;
- }
- }
- else if (groupType == "Business")
- {
- if (dayOfWeek == "Friday")
- {
- singularPrice = 10.90m;
- }
- else if (dayOfWeek == "Saturday")
- {
- singularPrice = 15.60m;
- }
- else if (dayOfWeek == "Sunday")
- {
- singularPrice = 16;
- }
- if (groupCount >= 100)
- {
- totalPrice = singularPrice * (groupCount - 10);
- }
- else
- {
- totalPrice = singularPrice * groupCount;
- }
- }
- else if (groupType == "Regular")
- {
- if (dayOfWeek == "Friday")
- {
- singularPrice = 15m;
- }
- else if (dayOfWeek == "Saturday")
- {
- singularPrice = 20m;
- }
- else if (dayOfWeek == "Sunday")
- {
- singularPrice = 22.5m;
- }
- if (groupCount >= 10 && groupCount <= 20)
- {
- totalPrice = (singularPrice * groupCount) * 95 / 100;
- }
- else
- {
- totalPrice = singularPrice * groupCount;
- }
- }
- Console.WriteLine($"Total price: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement