title: Class value passing in c#?
body: <p>I'm trying to pass values stored in a class to a program, but I am not sure how! I felt I was so close to completing this program but when running it it only displays what it is written in the actual program and it doesn't display options to store values on the class variable. If anyone could help me guide on what am I doing wrong it would be greatly appreciated. </p>
  
  <p>Here is the class I have written.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace ConsoleApplication4
  {
      class Pet
      {
          public string Name;
          public string Type;
          public double Age;
  
          public string setName()
          {
              Console.WriteLine("Please write your pet's name");
              Name = Console.ReadLine();
              return Name;
          }
  
          public string setType()
          {
              Console.WriteLine("What type of animal is your pet?");
              Type = Console.ReadLine();
              return Type; 
          }
  
          public double getAge()
          {
              Console.WriteLine("Input your pet's age"); 
              while(!double.TryParse(Console.ReadLine(), out Age))
                  Console.WriteLine("Please enter a valid number");
              return Age;
          }
      }
  }
  </code></pre>
  
  <p>And here is the actual program:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace ConsoleApplication4
  {
      class Program
      {
          static void Main(string[] args)
          {
              Pet mypet = new Pet();
              mypet.Name = "";
              mypet.Type = "";
              mypet.Age = 0;
  
              Console.WriteLine("The name of your pet is:" + mypet.Name);
  
              Console.WriteLine("The type of animal your pet is:" + mypet.Type);
  
              Console.WriteLine("The age of your pet is:" + mypet.Age);
          }
      }
  }
  </code></pre>