Results 1 to 3 of 3
Thread: strange alternating array
- 04-23-2009, 08:52 AM #1
Member
- Join Date
- Apr 2009
- Posts
- 1
- Rep Power
- 0
strange alternating array
Well hello java enjoyers, i am new to java but not programing all together. I know some python and c+ but not much else. I was trying to figure out away to write a program that reads a sequence of integers into an array list and computes the some of the numbers. But the computation must alternate in between + and -. For example
Number set [4,2,5,7,6,7]
computation 4+2-5+7-6+7=9
output 9
im snaning in the number set and trying to use a for loop but cant figure it out. Any suggestions?
- 04-23-2009, 09:00 AM #2
Post the code you're using. It's a bit tough to correct it without seeing it.
- 04-23-2009, 09:42 AM #3
Member
- Join Date
- Apr 2009
- Posts
- 20
- Rep Power
- 0
Similar Threads
-
Alternating Sum
By ScaryJello in forum New To JavaReplies: 6Last Post: 10-13-2009, 09:18 AM -
strange code
By tghn2b in forum New To JavaReplies: 3Last Post: 12-22-2008, 11:51 PM -
strange Error message
By little_polarbear in forum New To JavaReplies: 4Last Post: 08-25-2008, 11:45 PM -
Strange problem
By Tamir in forum EclipseReplies: 1Last Post: 08-18-2008, 09:44 PM -
Strange behaviour in swing
By cbalu in forum AWT / SwingReplies: 1Last Post: 05-23-2008, 09:23 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks