Showing posts with label arrayList. Show all posts
Showing posts with label arrayList. Show all posts
Monday, October 10, 2011 0 comments

CHALLENGE:Java Tut 29-Summing Elements of Arrays by theNewBoston

The following is a challenge for new developers that have completed:
 Java Tutorial - 29 Summing Elements of Arrays by theNewBoston
 


B.A.M.F Challenge:
B.A.M.F Challenges & why you want to always at leas try them explained Here:http://bit.ly/ogivqe
Difficulty: 1/2
 Create a java console program that stores 8 numbers between 1-100 in a array and then find the sum of all the numbers combined using a for loop.


CHALLENGE!!
(Before starting any of the challenges always declare a class and a main method unless told otherwise)
Difficulty:
1.Create a int array that stores 8 int's and name it values
2.Create a int var and name it sum
3.Create a for loop , set the counter to 0 to start, continue looping as long as the counter is less than the length of you're int array, increment the counter by 1 each time it loops.Each time it loops it should:
              * sum+= values[counter]  (sorry guys , couldn't think of a way to explain that part in words)

4.Print the sum.

COMPILE & PRAY TO DUKE The Java God!!!!

View the video tutorial: http://bit.ly/o7iT9P 

Monday, July 18, 2011 2 comments

CHALLENGE: Intermediate Java Tut's 4&5

The following is a challenge for new developers that have completed:
Intermediate Java Tutorial - 4&5 -Collections & arrayLists by theNewBoston



Legendary Challenge: 
Difficulty: ★ 1/2

Create two arrayLists, the first array must have 5 unique strings and the second array must consist of only the last 2 strings from the first array.Then create a method that will iterate through the first arrayList and filter out any strings that are also in the second array. Print your results.

Legendary Challenges consist of only a very broad description of the challenge making them a little harder.The end results should still be the same as the regular challenge.

CHALLENGE 
 Difficulty:
1. Create a String array named "things" containing the strings "eggs", "lasers","hats" and "pie"
2. Create a new ArrayList named "list1"
3. Create a For loop that adds the items from the array "things" to "list1"
4. Create a String array named "things2" containing only the strings "lasers" & "hats" 
5. Create a new ArrayList named "list2"
6. Create a For loop that adds the items from the array "things2" to "list2"
7.Print all the strings in list1 one using a for loop

End of Tut 4/Start of Tut 5

8.Create a method a called editList that uses two collection parameters and names them "A1" and "A2"
(to make it less confusing just remember that in a later step we will call the editList method and use "list1" & "list2" as parameters) 

9. Inside the editList method loop through each string in "A1" and make sure none of the strings are the same as any of the strings in "A2" 

10.If any of the strings from "A1" do match any of the strings from "A2" delete the string from "A1"

11.Call the editList method using "list1" & "list2" as parameters

12.Print a blank line

13.Print each of the strings in list1 using a for loop 

Note: Please keep in mind this blog is a work in progress and ive learned quickly that teaching is alot harder than just following along . If something is explained poorly or you have a suggestion to reword a step please leave a comment below so we can make this the best resource possible for up and coming developers.


View the video tutorial: http://youtu.be/jU5ACV5MucM
               Text walk-through of this tutorial: Coming Soon!!!


 
;