Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Practice___Vacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Input
- double numberOfPersons = int.Parse(Console.ReadLine());
- string typeOfGuests = Console.ReadLine();
- string dayOfTheWeek = Console.ReadLine();
- // Strings for type of guests
- string students = "Students";
- string Business = "Business";
- string Regular = "Regular";
- // Strings fot type of the day
- string friday = "Friday";
- string saturday = "Saturday";
- string sunday = "Sunday";
- //Main variables
- double price = 0.0;
- double totalPrice = 0;
- //Cheking for correct types peoples and days
- //Calculatin the total amouth for the group
- if (typeOfGuests == students)
- {
- if (dayOfTheWeek == friday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 30 || typeOfGuests == students)
- {
- price = 8.45;
- totalPrice = price * numberOfPersons;
- double discount = totalPrice * 0.85;
- Console.WriteLine($"Total price: {discount:F2}");
- }
- else
- {
- price = 8.45;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- else if (dayOfTheWeek == saturday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 30 || typeOfGuests == students)
- {
- price = 9.80;
- totalPrice = price * numberOfPersons;
- double discount = totalPrice * 0.85;
- Console.WriteLine($"Total price: {discount:F2}");
- }
- else
- {
- price = 9.80;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- else if (dayOfTheWeek == sunday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 30 || typeOfGuests == students)
- {
- price = 10.46;
- totalPrice = price * numberOfPersons;
- double discount = totalPrice * 0.85;
- Console.WriteLine($"Total price: {discount:F2}");
- }
- else
- {
- price = 10.46;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- }
- else if (typeOfGuests == Business)
- {
- if (dayOfTheWeek == friday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 100 || typeOfGuests == Business)
- {
- price = 10.90;
- double discount = numberOfPersons - 10;
- totalPrice = discount * price;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- else
- {
- price = 10.90;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- else if (dayOfTheWeek == saturday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 100 || typeOfGuests == Business)
- {
- price = 15.60;
- double discount = numberOfPersons - 10;
- totalPrice = discount * price;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- else
- {
- price = 15.60;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- else if (dayOfTheWeek == sunday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 100 || typeOfGuests == Business)
- {
- price = 16;
- double discount = numberOfPersons - 10;
- totalPrice = discount * price;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- else
- {
- price = 16;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- }
- else if (typeOfGuests == Regular)
- {
- if (dayOfTheWeek == friday)
- {
- //Cheking do the groupe have discount ot not.
- if (numberOfPersons >= 10 && typeOfGuests == Regular && numberOfPersons <= 20)
- {
- price = 15;
- totalPrice = price * numberOfPersons;
- double discount = totalPrice * 0.95;
- Console.WriteLine($"Total price: {discount:F2}");
- }
- else
- {
- price = 15;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- else if (dayOfTheWeek == saturday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons <= 20 && typeOfGuests == Regular && numberOfPersons >= 10)
- {
- price = 20;
- totalPrice = price * numberOfPersons;
- double discount = totalPrice * 0.95;
- Console.WriteLine($"Total price: {discount:F2}");
- }
- else
- {
- price = 20;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- else if (dayOfTheWeek == sunday)
- {
- //Cheking do the groupe have discount ot not
- if (numberOfPersons >= 10 && numberOfPersons <= 20 && typeOfGuests == Regular)
- {
- price = 22.50;
- totalPrice = price * numberOfPersons;
- double discount = totalPrice * 0.95;
- Console.WriteLine($"Total price: {discount:F2}");
- }
- else
- {
- price = 22.50;
- totalPrice = price * numberOfPersons;
- Console.WriteLine($"Total price: {totalPrice:F2}");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement