Help with visual basic .net code

Hi all...
Could anyone help me with this code?
I need to create a base class "shopkeeper" with the following...

Constructor(take first name and last name as arguments)
Properties (First name and last name)
Method...To String (overrides the base class method and returns the full name of student in form)
Abstract read only property...(Monthly pay)

This is what I have so far''''

Public Class Employee
Private strFirstName As String
Private strLastName As String

Public Sub New(ByVal FirstName As String, ByVal LastName As String, _
ByVal AnnualSalary As Integer)




End Sub
End Class

Any help or pointers would be much appreciated.

Thanks

Comments

  • : Hi all...
    : Could anyone help me with this code?
    : I need to create a base class "shopkeeper" with the following...
    :
    : Constructor(take first name and last name as arguments)
    : Properties (First name and last name)
    : Method...To String (overrides the base class method and returns the full name of student in form)
    : Abstract read only property...(Monthly pay)
    :
    : This is what I have so far''''
    :
    : Public Class Employee
    : Private strFirstName As String
    : Private strLastName As String
    :
    : Public Sub New(ByVal FirstName As String, ByVal LastName As String, _
    : ByVal AnnualSalary As Integer)
    :
    :
    :
    :
    : End Sub
    : End Class
    :
    : Any help or pointers would be much appreciated.
    :
    : Thanks
    :
    well first of all, you need to declare the monthly pay property, or annual pay property i am not sure which becuase your new statemnet gets passed the annual. anyways another thing, when you use the new statement, do you really need to pass the annualsalary? above you noted the constructor would only take first and last names as arguments. Also, you should pass the values by reference instead of byvalue, as when you pass them with byvalue, you are creating a new copy of the variable, therfore using double the neccessary amount of memory required. If the actual values (the actual variable value) will be altered and this is not the situation you want (as maybe the values are needed later) then passing byval is ok. anyways, to create a class is simple. you need a constructor and a destructor, properties and members, and also get and set functions. all you need to create is the constructor/destructor and also functins named getFirstName, getLastName,setFirstName, setLastName, and so on to protect the data integrity of the class. check out a book dealing with object oriented programming.
  • : : Hi all...
    : : Could anyone help me with this code?
    : : I need to create a base class "shopkeeper" with the following...
    : :
    : : Constructor(take first name and last name as arguments)
    : : Properties (First name and last name)
    : : Method...To String (overrides the base class method and returns the full name of student in form)
    : : Abstract read only property...(Monthly pay)
    : :
    : : This is what I have so far''''
    : :
    : : Public Class Employee
    : : Private strFirstName As String
    : : Private strLastName As String
    : :
    : : Public Sub New(ByVal FirstName As String, ByVal LastName As String, _
    : : ByVal AnnualSalary As Integer)
    : :
    : :
    : :
    : :
    : : End Sub
    : : End Class
    : :
    : : Any help or pointers would be much appreciated.
    : :
    : : Thanks
    : :
    : well first of all, you need to declare the monthly pay property, or annual pay property i am not sure which becuase your new statemnet gets passed the annual. anyways another thing, when you use the new statement, do you really need to pass the annualsalary? above you noted the constructor would only take first and last names as arguments. Also, you should pass the values by reference instead of byvalue, as when you pass them with byvalue, you are creating a new copy of the variable, therfore using double the neccessary amount of memory required. If the actual values (the actual variable value) will be altered and this is not the situation you want (as maybe the values are needed later) then passing byval is ok. anyways, to create a class is simple. you need a constructor and a destructor, properties and members, and also get and set functions. all you need to create is the constructor/destructor and also functins named getFirstName, getLastName,setFirstName, setLastName, and so on to protect the data integrity of the class. check out a book dealing with object oriented programming.
    :
    Thans for your help, much appreciated
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories