hw7 - 3. Write a method that takes a one-dimensional array...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 302 Homework 7 - Due Thursday, July 14 Name: 1. Declare and create the following arrays: (a) a one-dimensional array of type int and size 20 named arr . (b) a two-dimensional array of type double that is 3 by 4 named darr . (c) a three-dimensional array of type boolean whose Frst two dimensions are 5 by 4 and whose last dimension is not initialized named barr . 2. Declare an array of 20 Rectangle objects and initialize each element of the array to a Rectangle object located at (0 , 0) with width 40 and height 20.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3. Write a method that takes a one-dimensional array of double s as its only parameter and returns the second largest value. or example, if the input were an array that contained the numbers 1.0, 5.6, 4.5, 2.3 , the method would return 4.5 . 4. Write a method that takes a one-dimensional array of Rectangle objects as its only parameter and returns a new array that is twice as large and contains each element of the old array....
View Full Document

Ask a homework question - tutors are online