The George Washington University
School of Engineering and Applied Science
Department of Electrical Engineering and Computer Science

CSci 131 - Data Structures
Week 1 Homework

1. Does fixed-point representation or floating-point representation provide a wider range of values for a specific number of bits? Explain.

2. Write a type definition for each of the following::

a. A collection of ten integers

b. Student information containing a 25 character name, an integral final exam grade, a real average, and a character for the final grade

c. A group of 45 students

d. A class definition containing a 45 character instructor name and information for 45 students

3. Provide each of the following array or record aggregates:

a. A collection of ten integers initialized to all zeroes

b. Student information containing your name, a final exam grade of 90, an average grade of 96.5, and a final grade of A

4. Given the following type declarations:

TYPE Seasons IS (Winter, Spring, Summer, Autumn);
SUBTYPE Semesters IS Seasons RANGE Spring..Autumn;
TYPE Quarters IS NEW Seasons;

which are subtype declarations and which are derived types?

5. Given the following variable declarations based on the type declarations of the preceding problem:

Season: Seasons;
Semester: Semesters;
Quarter: Quarters;

indicate whether each of the following assignments is type compatible and, for those that are, whether they are always range compatible:

a. Season := Semester;

b. Quarter := Season;

c. Quarter := Semester;

d. Semester := Season;