Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ProgrammingFundamentals
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- int people = int.Parse(Console.ReadLine());
- string groupType = Console.ReadLine();
- string dayOfWeek = Console.ReadLine();
- decimal price = 0;
- decimal totalPrice = 0;
- if (groupType == "Students")
- {
- if (dayOfWeek == "Friday")
- {
- price = people * 8.45M;
- if (people >= 30)
- {
- totalPrice = price - price * 0.15M;
- }
- else
- {
- totalPrice = price;
- }
- }
- else if (dayOfWeek == "Saturday")
- {
- price = people * 9.80M;
- if (people >= 30)
- {
- totalPrice = price - price * 0.15M;
- }
- else
- {
- totalPrice = price;
- }
- }
- else if (dayOfWeek == "Sunday")
- {
- price = people * 10.46M;
- if (people >= 30)
- {
- totalPrice = price - price * 0.15M;
- }
- else
- {
- totalPrice = price;
- }
- }
- }
- else if (groupType == "Business")
- {
- if (dayOfWeek == "Friday")
- {
- if (people >= 100)
- {
- people = people - 10;
- }
- price = people * 10.90M;
- totalPrice = price;
- }
- else if (dayOfWeek == "Saturday")
- {
- if (people >= 100)
- {
- people = people - 10;
- }
- price = people * 15.60M;
- totalPrice = price;
- }
- else if (dayOfWeek == "Sunday")
- {
- if (people >= 100)
- {
- people = people - 10;
- }
- price = people * 16;
- totalPrice = price;
- }
- }
- else if (groupType == "Regular")
- {
- if (dayOfWeek == "Friday")
- {
- price = people * 15;
- }
- else if (dayOfWeek == "Saturday")
- {
- price = people * 20;
- }
- else if (dayOfWeek == "Sunday")
- {
- price = people * 22.50M;
- }
- if (people >= 10 && people <= 20)
- {
- totalPrice = price - price * 0.05M;
- }
- else
- {
- totalPrice = price;
- }
- }
- Console.WriteLine($"Total price: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement