CS 2401 Quiz #2

Date: Thursday, June 21, 2012.

1. You are given a one-dimensional array of doubles. Write a method that sets to zero array elements that are negative. Your method should return the number of negative elements found.
























2. Trace your method for an array with the following elements {9.8, 1.022, -1.6, -3.14}














3. Please answer the following questions about your reading assignment:

a. In Java you can create n-dimensional arrays. What is n and what values can it have?

b. What is a ragged array?