How to determine if a dollar amount has been doubled

maynard

Member
Joined
Nov 17, 2009
Messages
15
Programming Experience
Beginner
Hello VB.net users,

I'm new to this forum so I hope I'm posting in the right spot.

By entering a dollar amount and interest rate. I'm trying to figure out how I would evaluate when the dollar amount has been doubled. I already have a do while loop to determine when the dollar amount reaches a million, which works fine. Any suggestions?
 
Hmm, I'm not actually sure what you mean. This is what I have in my loop right now.

Do While dblTotalAmt <= 1000000
dblTotal = dblAmt * sngInterestRate
dblTotal += dblAmt
dblTotalAmt += dblTotal
intCountMillion += 1

Loop

This is working for giving me the number of years to reach a million. Should I put a nested loop inside this loop or write an if statement?

if dblTotal = dblTotal * 2 Then
"Do something here"
end if

Sorry if this is a stupid question but I'm really new to programming.
 
Please don't post the same question more than once. Your duplicate thread has been deleted and this thread has been moved to the VB.NET general forum. The VS.NET General forum is for general questions about the VS.NET IDE, not the VB.NET language.
 
maynard said:
By entering a dollar amount and interest rate. I'm trying to figure out how I would evaluate when the dollar amount has been doubled.
Step number one would be to determine what the figure will be when it is doubled. So, you take the entered amount and multiply it by 2. Now, you have a new figure with which comparisions can be made.

Example: I enter $1,000

That will be doubled when the amount reaches $2,000, correct?

What I'm not sure of is what you want to do when the amount reaches double?

One the one hand you are trying to figure out how many years it would take for my $1,000 to reach a million, so I don't understand what you want with the entered amount being doubled.
 
Back
Top