Question: Examine and study each method carefully! WRITE 3 METHODS: 1. sumArrayList() This method must return int, which is the sum each int in 1-D array.

Examine and study each method carefully! WRITE 3 METHODS: 1. sumArrayList() This method must return int, which is the sum each int in 1-D array. You must use a 'normal' for loop (counting loop). Use a wrapper Integer with number at each index. It should take about 6 lines of code, at most. 2. sumArrayListEnhancedForLoop() This method returns an int by summing each int in 1-D array, using and 'enhanced' for loop, not a counting loop. Cast from Integers with (int). It should take about 3 lines of code, at most. 3. pctNegNumbers() This method returns an int, the percent negative numbers (rounded) in array. Use an Enhanced For Loop (not a counting loop!). Round the result to an integer (no decimal places), using (int) cast of a double. This program demonstrates: ARRAYLIST - how values stored into an object - how objects must first convert to objects - ArrayList return - ArrayList .add() method - use of ArrayList .size() method STRING - use of String .length() method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!