Using maths behind the scenes... Newbie

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Hi I need to be able to use VB.net as a kind of calculator. Basically I
want to use it to work out holiday travel prices. There would be several
variables such as: -
number of people going
days going for
worldwide or European
ski cover included

etc...

please advise me the best way to work on a project like this an maybe give
and example with code???

Thanks for your time...

Scott
 
VB.NET has a System.Math namespace, that provides constants and static
methods for trigonometric, logarithmic, and other common mathematical
functions.

We can't give you examples unless you ask specific questions.
 
Ok for instance if one radio button is clicked the price is doubled and
another the price increases by £10.
 
Handle the appropiate events for the radio buttons. Perform requested
actions on values.

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles RadioButton1.CheckedChanged

REM mintBaseValue is private member variable.
REM mintResultValue is private member variable.
mintResultValue = mintBaseValue * 2

End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles RadioButton2.CheckedChanged

REM mintBaseValue is private member variable.
REM mintResultValue is private member variable.
mintResultValue = mintBaseValue + 10

End Sub

Add both radio buttons to same groupbox, if only one of them may be checked.
 
Scott,

Something tells me you want to practice with If then statements and/or case
statements to control which calculation is done when. In the continuation of
this same discussion in the fresh post above this one, the two who answered
also had good points.

It's tempting to create a nice form first, but what about trying to test
your calculations first.

Get a variable for how many people, and calculate a price. Display this
price somehow.

Then get a variable for Europe or not, and calculate a price. Display.

Then put them together. Display.

Each time, double-check the calculated result to make sure it's accurate.
Make sure you're doing a currency conversion if you have to (and how will you
get those rates, since they change constantly).

Then choose some condition that affects the cost by an increment, like ski
cover or not. Display.

Then put those together.

Best of luck from

Lesley (have a great holiday)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top