Jump to content

currency converter.vbs

- - - - -

  • Please log in to reply
3 replies to this topic

#1
tsmitt

tsmitt

    Newbie

  • Members
  • Pip
  • 2 posts
hey im trying to do this question

Use a for Next Loop to convert Euros $50 to $100 to the equivalent amount Australian dollars increasing by $10 each time.
the exchange rate is 1.3777.
needs to look like this

Euro$ AUS$
$50 $68.85
$60 $82.62
$70 $96.39
$80 $110.16
$90 $123.93
$100 $137.70

so far this is what i have
Option Explicit

Dim intEuro
Dim curAUD
Dim msgLine
Dim msgNextLine
Const Exchange Rate = 1.3777

i dont get what i have to do from there please helpp

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
For Next loops are written this way in VB: (simplified)

For counter [ As datatype ] = start To end [ Step step ]

    [ statements ]

Next [ counter ]

That should get you started.
Source: For...Next Statement (Visual Basic)
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3
tsmitt

tsmitt

    Newbie

  • Members
  • Pip
  • 2 posts
nah man, i need it in .vbs not .vb

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
Here's the documentation on how to do For loops in VBScript:
VBScript Looping Statements

Basically the same thing, except you don't need the counter after the Next. Example: (taken from the site)

For i=2 To 10 Step 2

    some code

Next


Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users