CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

Help with inheritance topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2010, 09:11 PM
 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
manuozzie is on a distinguished road
| More
Help with inheritance

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:58 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board