Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp133
- {
- class Program
- {
- static void Main(string[] args)
- {
- int people = int.Parse(Console.ReadLine());
- string groupType = Console.ReadLine();
- string dayOfWeek = Console.ReadLine();
- double price = 0;
- double discount = 0;
- double total = 0;
- //COMMON PRICES
- if (dayOfWeek == "Friday")
- {
- if (groupType == "Students")
- {
- price = 8.45;
- }
- else if (groupType == "Business")
- {
- price = 10.90;
- }
- else if (groupType == "Regular")
- {
- price = 15;
- }
- }
- else if (dayOfWeek == "Saturday")
- {
- if (groupType == "Students")
- {
- price = 9.8;
- }
- else if (groupType == "Business")
- {
- price = 15;
- }
- else if (groupType == "Regular")
- {
- price = 20;
- }
- }
- else if (dayOfWeek == "Sunday")
- {
- if (groupType == "Students")
- {
- price = 10.46;
- }
- else if (groupType == "Business")
- {
- price = 16;
- }
- else if (groupType == "Regular")
- {
- price = 22.5;
- }
- }
- //START DISCOUNTS
- if (people >= 30 && groupType == "Students")
- {
- discount = (price * people) * 0.15;
- total = (price * people) - discount;
- Console.WriteLine($"Total price: {total:f2}");
- }
- else if (people >= 100 && groupType == "Business")
- {
- people -= 10;
- total = price * people;
- Console.WriteLine($"Total price: {total:f2}");
- }
- else if (people >= 10 && people <= 20 && groupType == "Regular")
- {
- discount = (price * people) * 0.05;
- total = (price * people) - discount;
- Console.WriteLine($"Total price: {total:f2}");
- }
- else
- {
- total = people * price;
- Console.WriteLine($"Total price: {total:f2}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment