It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Program Help

Moderator: dafunkymunky

Program Help

Postby peter2005 on Mon Feb 26, 2007 10:30 pm

Sorry if this is the wrong area, it's my first time using this forum.

I've been given a task to do with a visual basic program and i don't have a clue how to do it. Im using Visual Basic 6.0.

The program has to work out the price of a car rental.
The program has to ask for the following: Customer name, Price bracket of car and Number of days hired.
There are 3 price brackets, Bracket A:£50 B:£70 C:£90
A car can be hired for a minimum of 1 day and a maximum of 100 days. Half days are not taken into account only full days.There's also a discount of £2 for people who hire a car for 14 days or more.

Any tips would be very much appreciated, thanks for any help in advance. :)
peter2005
 
Posts: 0
Joined: Mon Feb 26, 2007 10:28 pm

Postby amino0o on Thu Jun 28, 2007 11:34 pm

ok i assume u have SOME knowlage of VB so im gona skip the part as to where u PUT the code

first declare this

dim name as string
dim bracket as integer
dim days as integer
dim discount as boolean
dim price as integer

then put 3 option boxes and add the prices to them, just as 50 , 70 and 90 , make sure its their captions

then this :

name = nametextbox.text
bracket = optionwhatever.caption
days = daystext.text

if days > 1 then
msgbox "invalid number"
elseif days < 100 then
msgbox "inbalid number"

end if

if days < 14 then
total = caption - 2
else
total = caption

end if


Done.





amino0o
amino0o
 
Posts: 6
Joined: Thu Jun 28, 2007 11:11 pm


Who is online

Users browsing this forum: No registered users and 2 guests