please some one help me with this code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simply
    New Member
    • Apr 2007
    • 1

    #1

    please some one help me with this code

    hi
    i'm new member can someone help me with this code is for create a class car

    is creating a class car that has 3 private properties
    make , model , elapsedmileage as string

    the car class is making only from "old" or "chevrolet"

    also there is a function drive that returms a msg just after calculating the elapsedmileage which is equal to the current elapsedmileage + miles

    the msg format" make & " " & model & "has" & elapsedmileage &" miles"

    also there is another class the name of it class utility which has only one function that cal gas price and it is = to miles * 0.40

    in the class form
    only one button and one txtbox for the miles

    in the button we have to declare and create a car obj

    the properties
    make= "old"
    model= " ???"
    elapsedmileage =10000
    make= "BMW"

    then a msg popup of property make


    i already did some of the class car coding and i couldn't complete coz i didn't know how

    this is what i wrote of the code
    Dim m_make As String
    Dim m_model As String
    Dim m_elapsedMileag e As String

    Public Sub New(ByVal Model As String, _
    ByVal Make As String, _
    ByVal elapsedMileage As String)
    m_make = Make
    m_model = Model

    m_elapsedMileag e = elapsedMileage
    End Sub

    Public Property Make() As String
    Get
    Return m_Make
    End Get
    Set(ByVal value As String)
    m_Make = Value
    End Set
    End Property

    Public Property Model() As String
    Get
    Return m_Model
    End Get
    Set(ByVal value As String)
    m_Model = Value
    End Set
    End Property



    can someone help me with the rest of the coding,plz (i'm using vb.net 2005)
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by simply
    hi
    i'm new member can someone help me with this code is for create a class car

    is creating a class car that has 3 private properties
    make , model , elapsedmileage as string

    the car class is making only from "old" or "chevrolet"

    also there is a function drive that returms a msg just after calculating the elapsedmileage which is equal to the current elapsedmileage + miles

    the msg format" make & " " & model & "has" & elapsedmileage &" miles"

    also there is another class the name of it class utility which has only one function that cal gas price and it is = to miles * 0.40

    in the class form
    only one button and one txtbox for the miles

    in the button we have to declare and create a car obj

    the properties
    make= "old"
    model= " ???"
    elapsedmileage =10000
    make= "BMW"

    then a msg popup of property make


    i already did some of the class car coding and i couldn't complete coz i didn't know how

    this is what i wrote of the code

    Code:
        Dim m_make As String
        Dim m_model As String
        Dim m_elapsedMileage As String
    
        Public Sub New(ByVal Model As String, _
    ByVal Make As String, _
    ByVal elapsedMileage As String)
            m_make = Make
            m_model = Model
    
            m_elapsedMileage = elapsedMileage
        End Sub
    
        Public Property Make() As String
            Get
                Return m_Make
            End Get
            Set(ByVal value As String)
                m_Make = Value
            End Set
        End Property
    
        Public Property Model() As String
            Get
                Return m_Model
            End Get
            Set(ByVal value As String)
                m_Model = Value
            End Set
        End Property
    can someone help me with the rest of the coding,plz (i'm using vb.net 2005)
    Greetings, simply!

    I am do not know VB.net, but it does not look like you told us what the code is not doing:

    (1) What happens when you run it?

    (2) What errors, if any, are you getting?

    Also, I would suggest you get a chunck of your code working before moving on to further steps. Don't listen to me though if you know what you are doing, just adding my own technique. I am getting better at VB 6.

    Good of you to add your code, it will help helpful members here see what you're up against. Please stay tuned and Welcome!

    Added some tags for you to help better read it...

    Dököll

    Comment

    Working...