i have run into some problems with how to make this one work.
The FloatingNumbersWhileAdd Class (while-statement) "The name "
In this section, the program lets the user feed in values that can be real numbers or integers.
The program does not require the user to specify the number of values to be read. "How do i tell the program this?"
It stops reading when the user writes a zero value." I cant get this to work?"
A while statement is the best choice when the number of iterations is not known. "I cant get it to stop? it just continues in an endless loop".
There are two important requirements.
1:Use double data type for the numeric values.
2:Use a while statement to perform the iteration.
"This is the code i had from the beginning."
"This is what it should do."
Now i know that the code i have now is a mess and i need to clean it up but at this point im just testing as much as i can and i feel like my head is about to explode.
Hope anyone have some ideas on what i am doing wrong
Public Class FloatingpointsNumberWhileAdd Dim done As Boolean = False Dim index As Double = 0 Dim endNumber As Double = 0 Private summation As Double Public Sub start() writeprograminfo() readvaluesandsumnumbers() writeresult() End Sub Private Sub writeprograminfo() Console.WriteLine("To finish input write a zero. ") Console.Write("enter double: ") index = Integer.Parse(Console.ReadLine()) End Sub Private Sub readvaluesandsumnumbers() input.readDoubleConsole() input.readDoubleConsole() While Not done If Not done Then Console.Write("enter double") End While End Sub Private Sub writeresult() summation = index + index Console.Write("summation: " & summation) End Sub End Class