Console.WriteLine doesnt work in my for loop?

Reuben Hattingh 21 Reputation points
2021-04-08T04:35:08.11+00:00

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

Developer technologies VB
{count} votes

Accepted answer
  1. Castorix31 90,521 Reputation points
    2021-04-08T04:42:24.52+00:00

    Are you sure for :

    count >= years ?

    Shouldn't it be :

    count <= years ?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.