using System.Collections.Generic;
public Data(String name,int months,String offer,double fees)
public static void Main()
String sub=id.Substring(1);
char[] idno = sub.ToCharArray();
int[] m=new int[idno.Length];
double maxFees = double.MinValue;
double minFees=double.MaxValue;
List<Data> objList = new List<Data>();
for (int i = 0;i < idno.Length;i++)
m[i] = (int)Char.GetNumericValue(idno[i]);
Console.WriteLine("Welcome to use Sport Membership Calculator");
Console.Write("Enter customer name " +(i+1)+ ":");
Console.Write("Enter the number of months:");
months=Convert.ToInt32(Console.ReadLine());
if(months>=1 && months<=60)
Console.Write("Ether yes or no to indicate a special offer:");
offer=Console.ReadLine();
if(months>=1 && months<=6)
if(offer=="yes"||offer=="Yes")
else if(months>6 && months<=12)
if(offer=="yes"||offer=="Yes")
else if(months>12&& months<=60)
if(offer=="yes"||offer=="Yes")
Console.WriteLine("Invalid months please enter months between 1 - 60");
Console.WriteLine("The membeship of fee from "+name+" is $"+fees);
Console.WriteLine("-------------------------------------------------------------");
objList.Add(new Data(name,months,offer,fees));
Console.WriteLine("\t\t\t Summary of Membership Fee");
Console.WriteLine("=================================================================");
Console.WriteLine("\t Name \t\t Months \t\t SpecialOffer \t\t Charge");
Console.WriteLine("-----------------------------------------------------------------");
foreach (var record in objList)
Console.WriteLine("\t {0,-18}{1,-18}{2,-18}{3,-18}", record.Name, record.Months,record.Offer,record.Fees);
Console.WriteLine("-----------------------------------------------------------------");
foreach (var record in objList)
if (record.Fees > maxFees)
Console.WriteLine("The customer spending most is " + maxName +" $"+ maxFees);
foreach (Data record in objList)
if (record.Fees < minFees)
Console.WriteLine("The customer spending least is " + minName+" $"+ minFees);
Console.WriteLine("The number of member with < 6 months: "+minMonths);
Console.WriteLine("The number of member with >= 6 months: "+maxMonths);