namespace Problem_6.Theatre_Promotions { using System; public class Program { public static void Main() { var dayType = Console.ReadLine(); var age = int.Parse(Console.ReadLine()); if (dayType == "Weekday") { if (age >= 0 && age <= 18) { Console.WriteLine("12$"); } else if (age > 18 && age <= 64) { Console.WriteLine("18$"); } else if (age > 64 && age <= 122) { Console.WriteLine("12$"); } else { Console.WriteLine("Error!"); } } else if (dayType == "Weekend") { if (age >= 0 && age <= 18) { Console.WriteLine("15$"); } else if (age > 18 && age <= 64) { Console.WriteLine("20$"); } else if (age > 64 && age <= 122) { Console.WriteLine("15$"); } else { Console.WriteLine("Error!"); } } else if (dayType == "Holiday") { if (age >= 0 && age <= 18) { Console.WriteLine("5$"); } else if (age > 18 && age <= 64) { Console.WriteLine("12$"); } else if (age > 64 && age <= 122) { Console.WriteLine("10$"); } else { Console.WriteLine("Error!"); } } else { Console.WriteLine("Error!"); } } } }
Standard input is empty
Standard output is empty
Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x00006] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Int32.Parse (System.String s) [0x00007] in <8f2c484307284b51944a1a13a14c0266>:0 at Problem_6.Theatre_Promotions.Program.Main () [0x0000b] in <ba5f4c470d744d3083dd3cd6e6c0e723>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x00006] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Int32.Parse (System.String s) [0x00007] in <8f2c484307284b51944a1a13a14c0266>:0 at Problem_6.Theatre_Promotions.Program.Main () [0x0000b] in <ba5f4c470d744d3083dd3cd6e6c0e723>:0