For my class I am asked to complete a program: create an application that will predict the approximate sie of a population of organisms. the user should select or enter the starting number of organisms in a combo box, enter the average daily population increase (as a percentage) in a text box, and select or enter the number of days the organisms will be lef tot multiply in another combo box.
My issues are: In the list box my final results are lining up in two columns and the math wont turn out correctly. I also cant get the days(which is one of the columns) to go from 1 to the number of days the user selects. so my question is what went wrong with my code?
Public Class Form1 Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click Dim Intcount As Integer Dim intMultipied As Integer intMultipied = 0 Dim intFinalCalc As Integer Dim intadded As Integer Dim daysmultiplied As String intadded = 1 daysmultiplied = CBool(cboDaysToMultiply.SelectedItem) Intcount = 1 For Intcount = 1 To cboDaysToMultiply.SelectedItem intMultipied = cboNumOfOrgan.SelectedItem * Intcount intadded = intMultipied * txtAveDailyInc.Text Intcount += 1 intFinalCalc = intadded * cboDaysToMultiply.SelectedItem Dim strOut As String = String.Empty strOut &= "Day " & cboDaysToMultiply.SelectedItem lstFinalData.Items.Add(strOut) strOut &= "Approximate Population " & intFinalCalc.ToString lstFinalData.Items.Add(strOut) Next End Sub End Class