Parametric Data Types
Warm Up
Hard Work
Version: 5.2.1

Lab 7a

Goals: The goals of this lab is to learn how to work with parametric data types.

Parametric Data Types

In the previous exercise we have defined two lists of items, but the only difference between them was the type of data the list contained.

In this part of the lab we will abstract over the data type the lists contain.

Warm Up

Start with a new project Lab7a and import into it the files saved in Lab7a.zip.

You should have the following files, where the IlO file contains a parametrized definition of a list of items of the type given by the parameter T:

Hard Work

Note: You probably won’t get to this part. You will do it at home as a homework assignment, but could start thinking about it now.

Rewrite the code from the first part of this lab so that it uses a parametrized list of items for the list of Personss and the list of Accounts.