By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

please some one help me with this code

P: 1
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_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)
Apr 13 '07 #1
Share this Question
Share on Google+
1 Reply


Dököll
Expert 100+
P: 2,364
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

Expand|Select|Wrap|Line Numbers
  1.  
  2.     Dim m_make As String
  3.     Dim m_model As String
  4.     Dim m_elapsedMileage As String
  5.  
  6.     Public Sub New(ByVal Model As String, _
  7. ByVal Make As String, _
  8. ByVal elapsedMileage As String)
  9.         m_make = Make
  10.         m_model = Model
  11.  
  12.         m_elapsedMileage = elapsedMileage
  13.     End Sub
  14.  
  15.     Public Property Make() As String
  16.         Get
  17.             Return m_Make
  18.         End Get
  19.         Set(ByVal value As String)
  20.             m_Make = Value
  21.         End Set
  22.     End Property
  23.  
  24.     Public Property Model() As String
  25.         Get
  26.             Return m_Model
  27.         End Get
  28.         Set(ByVal value As String)
  29.             m_Model = Value
  30.         End Set
  31.     End Property
  32.  
  33.  
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
Apr 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.