University of Iowa Computer Science Department

Quiz 07

 

1. Write a C# code fragment that stores random integers between 1 and 50, inclusive, into an integer array dimensioned to be of size 16.

2. Assume that you are given a class called Name with a constructor that takes a first name and a last name as strings. Write a class called Person that has as instance variables an integer id and a variable of type Name called name. Write a constructor for your Person class that takes three arguments: a first name, a last name, and an id. The constructor should take care of the initialization the Person's instance variables.

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