public static void Main()
int[] weight = new int[MAX_DOGS];
string[] name = new string[MAX_DOGS];
while (userChoice != "5")
Console.WriteLine ("Enter 1 to enter name and weight");
Console.WriteLine("Enter 2 to get average");
Console.WriteLine("Enter 3 to display all");
Console.WriteLine("Enter 4 to find a name");
Console.WriteLine("Enter 5 to exit");
userChoice = Console.ReadLine();
EnterWeight(ref count, weight, name);
GetAverage(count, weight);
DisplayAllWeights(count, weight, name);
string lookup = Console.ReadLine();
sub = FindName(count, name, lookup);
DisplayDog(name, weight, sub);
static void EnterWeight (ref int count, int[] weight, string [] name)
Console.WriteLine("please enter name");
name[count] = Console.ReadLine();
Console.WriteLine("please enter weight");
weight[count] = int.Parse(Console.ReadLine());
static void GetAverage (int count, int[] weight)
for (int x =0; x < count; x++)
totalWeight += weight[x];
Console.WriteLine("Average weight is " + totalWeight / count);
static void DisplayAllWeights (int count, int[] weight, string [] name)
for(int x = 0; x < count; x++)
Console.WriteLine(name[x] + " weighs " + weight[x]);
static int FindName (int count, string [] name, string lookup)
for (int x = 0; x < count; x++)
static void DisplayDog (string [] name, int [] weight, int sub)
Console.WriteLine("dog not found");
Console.WriteLine(name[sub] + " " + weight[sub]);