Let's try this again:
//
while (m <=n){
temp = m *(Math.pow(1, -3)) - 2;
m+= 2;
localSum = (int) temp;
Type: Posts; User: Montrell79
Let's try this again:
//
while (m <=n){
temp = m *(Math.pow(1, -3)) - 2;
m+= 2;
localSum = (int) temp;
I think I'm a little closer now, but this method only works using the example given of m =5 and n =9, but not if I plug in other numbers that are more than 4 digits apart. I know there is an error in...
7 - 9 + 11 - 13 + 15 - 17 + 19 - 21 + 23 - 25 + 27 - 29 + 31 - 33 + 35 - 37 + 39 - 41 + 43 - 45 + 47 - 49 + 51 - 53 + 55 - 57 + 59 - 61 + 63 - 65 + 67 - 69 + 71 - 73 + 75 - 77 + 79 - 81 + 83 - 85 +...
I know what I need the loop to do, I just don't know how to execute it in the body of the loop. I'm very new to java and need to do this for a homework assignment. Let's use another example - m= 7...
I'm trying to create a method called myOddNum(int m, int n)
The method needs to obtain 2 odd integers from the user (ex: m = 5 and n = 9)
and it needs to calculate the following series: 5 - 7 + 9...