473,508 Members | 4,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

please some one help me with this code

1 New Member
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
1 1068
Dököll
2,364 Recognized Expert Top Contributor
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

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

Similar topics

0
1966
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
4
2572
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message...
2
2343
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
3570
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
1
9586
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
5
2575
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
1
54452
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
1
1257
by: lostsoul | last post by:
Can someone give me some pointer on the below program? There are three things that I couldn't do with my current program. 1) Whenever I make changes to the dictionary it doesn't save the changes. 2)...
4
2319
by: fatboySudsy | last post by:
Hi, I have constructed a client program that has given me some error codes that i just cannot see. I was wondering if a different set of eyes with much more experience than me could help me out. ...
0
2872
by: Teo | last post by:
Hi!! I have been trying to fix an error I keep getting on my VB.NET code. For some reason, I get an error saying "Invalid attempt to access a field before calling Read()" everytime. As you can see...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.