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 _2.Vacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- // First Input Info: 1. group of people (int) - 2. type of the group (string) - 3. which day of the week (string) +++
- /* Second Info: Based on that information calculate how much they have to pay and print that price on the console. Use the table +++
- Discount:
- • Students – if the group is bigger than or equal to 30 people you should reduce the total price by 15% +++
- • Business – if the group is bigger than or equal to 100 people 10 of them can stay for free. +++
- • Regular – if the group is bigger than or equal to 10 and less than or equal to 20 reduce the total price by 5% */
- int groupNum = int.Parse(Console.ReadLine());
- string groupType = Console.ReadLine();
- string day = Console.ReadLine();
- decimal price = 0;
- if (groupType == "Students")
- {
- if (day == "Friday")
- {
- price = 8.45M;
- }
- else if (day == "Saturday")
- {
- price = 9.80M;
- }
- else if (day == "Sunday")
- {
- price = 10.46M;
- }
- if (groupNum < 30)
- {
- Console.WriteLine($"Total price: {groupNum * price:F2}");
- }
- else
- {
- Console.WriteLine($"Total price: {groupNum * price * 0.85M:F2}");
- }
- }
- else if (groupType == "Business")
- {
- if (day == "Friday")
- {
- price = 10.90M;
- }
- else if (day == "Saturday")
- {
- price = 15.60M;
- }
- else if (day == "Sunday")
- {
- price = 16;
- }
- if (groupNum < 100)
- {
- Console.WriteLine($"Total price: {groupNum * price:F2}");
- }
- else
- {
- Console.WriteLine($"Total price: {(groupNum - 10) * price:F2}");
- }
- }
- else if (groupType == "Regular")
- {
- if (day == "Friday")
- {
- price = 15;
- }
- else if (day == "Saturday")
- {
- price = 20;
- }
- else if (day == "Sunday")
- {
- price = 22.50M;
- }
- if (groupNum < 10 || groupNum > 20)
- {
- Console.WriteLine($"Total price: {groupNum * price:F2}");
- }
- else if (groupNum >= 10 && groupNum <= 20)
- {
- Console.WriteLine($"Total price: {groupNum * price * 0.95M:F2}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement