Assignment #4:
Aggregation
Objectives: Gain experience designing classes using aggregation.
Description: This program is intended to provide you with additional experience with classes and object instantiation, as well as utilizing aggregation to take advantage of code reuse.
Develop a new class called clsReference that has the following members:
Public Class clsReference
Const numAuthors As Integer = 5
Private author ( numAuthors ) As clsName
Private title As String
Private pubDate As clsDate
Public Sub New ( )
Public Sub New ( ByVal last As String, ByVal first As String, ByVal mi As String, _
ByVal newTitle As String, ByVal mMonth As Integer, ByVal mDay As Integer, _
ByVal mYear As
Integer )
Public Sub setAuthor ( ByVal index As Integer, ByVal last As String, ByVal first As String, ByVal mi As
String )
Public Sub resetNumAuthors ( ByVal size As Integer )
Public Sub setTitle ( ByVal newTitle As String )
Public Sub setPubDate ( ByVal month As Integer, ByVal day As Integer, ByVal year As
Integer )
Public Sub setPubDate ( ByVal month As Integer, ByVal year As
Integer )
Public Sub setPubDate ( ByVal year As Integer )
Public Function getAuthorLastFirstMi ( ) As String
Public Function getAuthorLastFiMi ( ) As String
Public Function getAuthorLastFiMi_FirstMiLast ( ) As String
Public Function getAuthorLastFirstMi_FirstMiLast ( ) As String
*
Public Function getTitle ( ) As String
Public Function getTitleLowercase ( ) As String
Public Function getPubDate ( ByVal dateFormat As String ) As String
Protected Function convertToLowerCase ( ByVal changeText As
String ) As String
Protected Function
convertToTitleCase ( ByVal changeText As
String ) As String *
End Class
* Not in original spec so not required yet. You'll have to write it eventually....
The accessor and mutator methods for author must be capable of handling multiple names, i.e., an array of names. Refer back to the Reference Styles help sheet for examples.
Refer to the Composition notes for assistance.
