1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with inheritance

Discussion in 'C#' started by manuozzie, Sep 1, 2010.

  1. manuozzie

    manuozzie New Member

    Joined:
    Sep 1, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi guys,

    I'm really new in C# and OO programming and i need a little help. I'm trying to apply the refactoring concepts in this context.

    I have a Membership class:

    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace Third
    {
        class Membership
        {
            public const int NonMember = 0;
            public const int Bronze = 1;
            public const int Silver = 2;
            public const int Gold = 3;
            private int memberType;
            private Person person;
            
    
            public Membership(int memberType, Person person)
            {
                this.memberType = memberType;
                this.person = person;
                
            }
    
            public Membership(Person person)
            {
                this.person = person;
                
            }
    
    
            public int getMemberType()
            {
                return memberType;
            }
    
            public Person getPerson()
            {
                return person;
            }
    
            public void setperson(Person person)
            {
                this.person = person;
            }
        }
    }
    now I need to create 4 classes NonMember, Gold, Silver and Bronze that inherit from this class.

    Can you help me out to start?

    Thanks in advance.
     

Share This Page