• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array output question  RSS feed

 
Vinnie Vikro
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you get 17 from the following?

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Work out the math ... 0 + 0 + 1 + 2 + 10 + 4 = 17.

Henry


PS... welcome to the ranch
 
Vinnie Vikro
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can someone write lines 2-4 in english
 
Brian Barrick
Ranch Hand
Posts: 67
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinnie Vikro wrote:How do you get 17 from the following?



For i = 0 and as long as i < 5 do the following code and then add 1 to i
if/when i is equal to 3 do the code in between these brackets otherwise skip the code in these brackets
(in the brackets) result = result + 10

else(if i doesn't equal 3) do the code in this bracket
result = result + i
 
Liutauras Vilda
Sheriff
Posts: 4921
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinnie Vikro wrote:can someone write lines 2-4 in english
Have you tried to have a look at Oracle Java Tutorial (<-- link), it might would help.
After you go through tutorial, post here your thoughts, what is not really clear, we'll try to figure out together.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for being a bit terse with my response... ... Going back to the tutorials is definitely a better option than trying to "work out the math" -- especially since I didn't know what the confusing was.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!