question

ReubenHattingh-2736 avatar image
0 Votes"
ReubenHattingh-2736 asked DewayneBasnett-7583 commented

Console.WriteLine doesnt work in my for loop?

85507-vsprob.pngHi guys, doing an assignment atm for a basic term deposit calculator. The app recieves input from the user via textboxes in the form of deposit value, interest rate, and term length (number of years). Then it calculates the interest earned and displays a string in the console for each year in the form of:

"Year x: interest = z and deposit = z+initial deposit" - and then it continues the loop for the rest of the years.

For some reason in my for loop my Console.WriteLine method produces no output in the console window. However if I write something outside of the loop it shows. Can anyone help me


85586-image.png


dotnet-visual-basic
vsprob.png (31.5 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Your post was tagged incorrectly. It should have been dotnet-csharp,

0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered ReubenHattingh-2736 commented

Are you sure for :

count >= years ?

Shouldn't it be :

count <= years ?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Wow im an idiot lmao. Thanks so much!

0 Votes 0 ·