University of Iowa Computer Science Department

Quiz 05

 

1. Declare an integer array named square of length 10. Initialize square[i] with the value i*i for each value of i. Use the property associated with arrays in the for loop that you write.

2. Declare a class named Point with two instance variables named x and y. The Point class will be used to encode a point in two-dimensional space. Write a two-parameter constructor that will initialize these instance variables. Then write a ToString method that returns a string representation of the Point.

CLAS CRA ACM | ©2005 The University of Iowa | Modified: .