2 Replies - 380 Views - Last Post: 07 November 2012 - 03:15 PM Rate Topic: -----

#1 toketog  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-November 12

Problem with a mathematical type

Posted 07 November 2012 - 02:28 PM

Hello i have this type: U=Uo+a*t

And i want to make code for vb, where the user will enter in textboxes the number of Uo,a,t and in the result box to show to result of U

Thank you very much

http://img405.images...97/52527614.png
Is This A Good Question/Topic? 0
  • +

Replies To: Problem with a mathematical type

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5439
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Problem with a mathematical type

Posted 07 November 2012 - 02:31 PM

View Posttoketog, on 07 November 2012 - 03:28 PM, said:

And i want to make code for vb [...]


Well go right ahead. You don't have to announce to us what you want to make. Have fun!

Calculator tutorial: FAQ 31

rookie: What this shows us is that you aren't familiar with breakpoints and how to debug your own code.


tlhIn`toq's FAQ list

Learning to debug one's own code is an essential skill. Sadly, one that apparently few college courses teach. Silly if you ask me.

Placing breakpoints and walking through the code line by line allows you to actually WATCH it execute.

Visualizing what your code does will let you see why it behaves the way it does.

It would be well worth your time to do the tutorials on FAQ 2. A couple hours learning this skill will save you hundreds of hours of confusion in one project alone.


TOP most asked:
What does this error message mean?
FAQ 2: How do I debug
FAQ 3: How do I make Class1/Form1 talk to Class2/Form2


FAQ (Frequently Asked Questions - Updated NOV 2012
Spoiler



This post has been edited by tlhIn`toq: 07 November 2012 - 02:32 PM

Was This Post Helpful? 0
  • +
  • -

#3 coder3788  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 62
  • Joined: 06-November 12

Re: Problem with a mathematical type

Posted 07 November 2012 - 03:15 PM

Textboxes are controls that have properties. One of them is Text. When you insert values in them, Text holds the input. Text is a string. You do arithmetic on numbers.
Find out how to represent numbers (int,float,double,decimal,etc) and parse the strings to get numbers from them. When the user clicks Resaults (or Show result rather) ,replace the symbols from the equation with the actual numbers. Finally set the Text of the result textbox to the result of the equation (which is a number also), parsed as a string.

What you should learn from this, besides solving this particular problem is how to go about solving problems in general:
- decide what is the problem
- separate what you currently know about the problem from what you need to find out to solve it
- study what lies between your current knowledge and the solution
- solve it
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1