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

New to programming

Moderator: dafunkymunky

New to programming

Postby beginnerprogrammer on Tue May 18, 2010 10:11 pm

Hiya everyone,

I am new to programming and I was wondering if someone could help me with my if statement i am working on.

The program i am making is to calculate a hotel bill,
S for single room £60
T for twin room £90
D for double room £80
calculate roomtype by the no of nights stayed at the hotel.

Thank you very much for any help you can offer me

:D Beginnerprogrammer :D
beginnerprogrammer
 
Posts: 1
Joined: Tue May 18, 2010 9:55 pm

Re: New to programming

Postby radgator on Mon Jun 21, 2010 6:18 pm

Dim S As Double = 60.0
Dim T As Double = 90.0
Dim D As Double = 80.0
Dim Nights As Integer
Dim Rate As Double
Nights = TextBox2.Text


If TextBox1.Text = "S" Then
Rate = S * Nights
If TextBox1.Text = "T" Then
Rate = T * Nights
If TextBox1.Text = "D" Then
Rate = D * Nights
End If
End If
End If
radgator
 
Posts: 1
Joined: Mon Jun 21, 2010 5:47 pm


Who is online

Users browsing this forum: No registered users and 1 guest