OOPortal OOPortal

User Defined Types  «Prev  Next»

Create Class Diagram - Exercise

Classes as data types: How to prepare a class diagram?

Objective: Create a class diagram for your Check class.


This exercise is not scored. It's an opportunity for you to check your understanding of the material covered in the preceding lesson. When you are finished, click the


button to view the suggested results.


Assuming the existence of integer, floating-point, and string data types, prepare a class diagram for a Check class that represents a single check written on an account.


You may find it helpful to take a look at a check or an entry in your checkbook and note the information that is stored there. Pay particular attention to the information that is different for each check. Information that is the same from check to check (for example, the issuing bank) is generally not as important. Consider the relevance of the attribute to the class, whether it duplicates another attribute. Also consider if there would be any difficulty in applying one of the standard data types (integer, floating-point variable, or string) to the attribute.
If you are stuck, review the responsibilities of the Check class as presented in an earlier lesson:
Check represents a check. It tracks the amount, payee, check number, and date.
You may choose to add more attributes after examining your own checkbook or thinking about the purpose of the Checkbook Manager application.