I am trying to write a program where it calculates a persons bill at a fast food place. I got it working but there is an issue. I have a place where the person can add a tip but for some odd reason the tip isn't being added to the final price. Why? Here is my code:
Dim Burger As Double = 6.5
Dim Frie As Double = 4.5
Dim Drink As Double = 2.5
Dim Tip As Double
Dim Price As Double
Dim TotalPrice As Double
If IsNumeric(txtBurger.Text) And IsNumeric(txtFrie.Text) And IsNumeric(txtDrink.Text) Then
Burger = txtBurger.Text
Frie = txtFrie.Text
Drink = txtDrink.Text
Tip = InputBox("What percent tip would you like to add?")
Price = Burger * 6.5 + Frie * 4.5 + Drink * 2.5
TotalPrice = Price + Tip / 100
TotalPrice = MessageBox.Show("Your total price is: " & FormatCurrency(Price))
Else
MessageBox.Show("Error: Please input only numbers!")
End If
Dim Burger As Double = 6.5
Dim Frie As Double = 4.5
Dim Drink As Double = 2.5
Dim Tip As Double
Dim Price As Double
Dim TotalPrice As Double
If IsNumeric(txtBurger.Text) And IsNumeric(txtFrie.Text) And IsNumeric(txtDrink.Text) Then
Burger = txtBurger.Text
Frie = txtFrie.Text
Drink = txtDrink.Text
Tip = InputBox("What percent tip would you like to add?")
Price = Burger * 6.5 + Frie * 4.5 + Drink * 2.5
TotalPrice = Price + Tip / 100
TotalPrice = MessageBox.Show("Your total price is: " & FormatCurrency(Price))
Else
MessageBox.Show("Error: Please input only numbers!")
End If