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