Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.47 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace labb6uppg3
  7. {
  8.     class Animal
  9.     {
  10.         string name;
  11.         string sound;
  12.  
  13.  
  14.  
  15.  
  16.         public void makeSound()
  17.         {
  18.            
  19.  
  20.         }
  21.         public string Name
  22.         {
  23.             get { return name; }
  24.             set { name = value; }
  25.         }
  26.         public string Sound
  27.         {
  28.             get { return sound; }
  29.             set { sound = value; }
  30.         }
  31.         public class fish : Animal
  32.         {
  33.             private string watertype;
  34.  
  35.             public string Watertype
  36.             {
  37.                 get { return watertype; }
  38.                 set { watertype = value; }
  39.             }
  40.         }
  41.         public class salmon : fish
  42.         {
  43.             private string ocean;
  44.  
  45.             public string Ocean
  46.             {
  47.                 get { return ocean; }
  48.                 set { ocean = value; }
  49.             }
  50.         }
  51.         public class mammal : Animal
  52.         {
  53.             private string furType;
  54.             public string FurType
  55.             {
  56.                 get { return furType; }
  57.                 set { furType = value; }
  58.             }
  59.         }
  60.         public class cow : mammal
  61.         {
  62.             private string breed;
  63.             public string Breed
  64.             {
  65.                 get { return breed; }
  66.                 set { breed = value; }
  67.             }
  68.         }
  69.      
  70.  
  71.  
  72.        
  73.  
  74.  
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement