Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int groupSize = int.Parse(Console.ReadLine());
- string package = Console.ReadLine();
- double price=0;
- string hallName=HallName(groupSize);
- price=CalculatePrice(groupSize,package,price);
- if (groupSize<=120)
- {
- Console.WriteLine("We can offer you the {0}",hallName);
- Console.WriteLine("The price per person is {0:f2}$",price/groupSize);
- }
- else
- {
- Console.WriteLine("We do not have an appropriate hall.");
- }
- }
- public static double CalculatePrice(int groupSize,string package,double price)
- {
- bool smallgroup= 0<groupSize && groupSize<50;
- bool middleSizeGroup= 50<groupSize && groupSize<=100;
- bool bigGroup=groupSize>100 && groupSize<=120;
- if (smallgroup)
- {
- HallName(groupSize);
- switch(package)
- {
- case "Normal":
- price = (2500 + 500) - ((2500 + 500) * 0.05);
- return price;
- case "Gold":
- price= (2500 + 750) - ((2500 + 750) * 0.10);
- return price;
- case "Platinium":
- price = (2500 + 1000) - ((2500 + 1000) * 0.15);
- return price;
- }
- }
- if (middleSizeGroup)
- {
- HallName(groupSize);
- switch(package)
- {
- case "Normal":
- price = (5000 + 500) - ((5000 + 500) * 0.05);
- return price;
- case "Gold":
- price = (5000 + 750) - ((5000 + 750) * 0.10);
- return price;
- case "Platinium":
- price = (5000 + 1000) - ((5000 + 1000) * 0.15);
- return price;
- }
- }
- if(bigGroup)
- {
- HallName(groupSize);
- switch(package)
- {
- case "Normal":
- price = (7500 + 500) - ((7500 + 500) * 0.05);
- return price;
- case "Gold":
- price = (7500 + 750) - ((7500 + 750) * 0.10);
- return price;
- case "Platinium":
- price = (7500 + 1000) - ((7500 + 1000) * 0.15);
- return price;
- }
- }
- return 0;
- }
- public static string HallName(int groupSize)
- {
- bool smallgroup= 0<groupSize && groupSize<50;
- bool middleSizeGroup= 50<groupSize && groupSize<=100;
- bool bigGroup=groupSize>100 && groupSize<=120;
- if(bigGroup)
- {
- return"Great Hall";
- }
- if (middleSizeGroup)
- {
- return "Terrace";
- }
- if (smallgroup)
- {
- return"Small Hall";
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment