stevelg 18 Light Poster

One problem I can see is that you have created the textView in the Java code rather then within main.xml but not added the View to the layout. You czan create widgets in xml or in code (or both) but they need adding to a view group using
this.addContentView(text);
You may also need to add parameters for the widget size.

stevelg 18 Light Poster

You have not provided any code or listings it making it difficult for anyone to identify what the problem is!

I ave had problems creating the R.JAVA class caused by problems in the XML files that create it. If there is a single syntax error the compilation fails and no class is created. You should perhaps check the XML files used.

stevelg 18 Light Poster

At line 33 you have the assignment:
powerSeries = 1 +(negationFactor * (Math.pow(radians, expFact))/factorialResult)

This sets the variable powerSeries to a value of 1 plus the current calculated term in the loop, but the Cosine formula requires a total of such terms. You need to repeatedly add each term to a cumulative total as in:
powerSeries+=(negationFactor * (Math.pow(radians, expFact))/factorialResult)

To use this you must first initialise the variable so you need a line:
powerSeries=1;
before starting the while loop

The final result will then be 1 plus(or minus) each term calculated within the loop!

Ezzaral commented: Helpful +9
stevelg 18 Light Poster

The calculation for the power series evaluates each term adds 1 and then assigns this to the variable, overwriting any values from previous iterations. The final loop will then assign only 1 plus the last term. You need to accumulate the values from each term as it is caluclated. Hence;

powerseries+=Math.pow(degress,exp)...

If you inititiate power series to 1 before the while loop starts this should do it.

stevelg 18 Light Poster

Notwithstanding the validity of the above, you cannot simply create the array at the beginning as the program implies you do not know the number of records until the last one is indicated by entering Stop. Your own approach of creating a new variable each time to add to the array is correct.

The problem occurs in the values of index used. The input index 'i' is incremented after the record is saved and the next item requested or the end indicated. When stop is entered the loop exits without creating any new variable or extending the array, so the value of i is 1 beyond the last array element. In the printout you add 1 to i to ensure the for loop index reaches the last value of i which has no entry in the data. This is where the error will occur.

javaAddict commented: Thanks for correcting me +4