C
C#•3y ago
Kaoruko Waguri

Not sure what I'm doing wrong but my Total Fare is messed up [Answered]

Numbers don't add up
47 Replies
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
oh soo I have to add them before?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
why?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
I got it fixed
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
but now I have a different problems math problem 😦
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
so this is the example our teach gave us right
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
if you look at the estimated fare that's were I'm having problems because my Total fare is messed up
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
here's my code for UberX
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
the value is the one I made
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
nvm I had XL
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
for Uber X nvm Total fare still not matching up
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
deluvas
deluvas•3y ago
Because you add 2 times bookingFeeX instead baseFare
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
ooooooooh
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
for the last part this is the example my teach gave me and this is what I got
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Kouhai
Kouhai•3y ago
You're doing ToString on the textbox, you need to the Value
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
so I have to turn the textbox into a number?
Kouhai
Kouhai•3y ago
This line is essentially textBox6.ToString()
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
oh oh if I didn't put ToString it would indefinity as a number right?
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Kouhai
Kouhai•3y ago
The type TextBox has a property Text
Kouhai
Kouhai•3y ago
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
like that?
Kouhai
Kouhai•3y ago
what type is textBox6?
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
what do you mean by type> type?
Kouhai
Kouhai•3y ago
In C# all variables, fields and properties have a type here the type of the variable message is string
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
I dont think it has a variable I didn't set it up yet
Kouhai
Kouhai•3y ago
textBox6 is a control, right? That textbox has a type, in the case of a textbox the type is TextBox ToString() called on TextBox doesn't return what is currently typed in it
Kouhai
Kouhai•3y ago
It returns the type name that's why you get this
Kouhai
Kouhai•3y ago
Now to get the content's of a TextBox you have a property in TextBox named Text
Kaoruko Waguri
Kaoruko WaguriOP•3y ago
Yeah I just had to do .Text
Accord
Accord•3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server