Reputation: 37
I am trying to make a simple calculator. I am getting blue line under my numbers with the error "Method Name Expected"
I was hopeing you guys could help me out with my simple question from a noob.
finalCmb = .25(1.3(txtAtt.Text+txtStr.Text)+txtDef.Text+txtHp.Text+(.5(txtPray.Text))+(.5(txtSum.Text)));
Upvotes: 1
Views: 168
Reputation: 7358
finalCmb = .25 * (1.3 * ((double)txtAtt.Text + (double)txtStr.Text)+(double)txtDef.Text+ (double)txtHp.Text+ (.5 * ((double)txtPray.Text)) + (.5 * ((double)txtSum.Text)));
Upvotes: -1
Reputation:
You have to manually place multiplication operators. There is no bracket multiplication.
25(1.3(te...
should be 25 * (1.3 * (te...
Converting strings to numbers would be a good idea.
txtStr.Text
to Double.Parse(txtStr.Text)
Upvotes: 8
Reputation: 124800
Your syntax is wrong. The compiler thinks that you are trying to call a method due to the opening parentheses when you do this
.25(1.3 ...
I'm not sure what you are actually trying to accomplish with that, but it doesn't make sense. I would suggest spending some more time learning the basics.
Upvotes: 0