Assignment 2 – Media Contributions

Maximum Points = 50

 The purpose of this lab is to focus on the study of classes, objects, and inheritance.

 

The faculty at CSU are being asked to keep track of their professional and service contributions. One particular set of these are media contributions (TV, radio, newspapers, magazines, Internet).

 

BASIC ASSIGNMENT

a)    Design and implement a base class that represents media contributions. A media contribution has a code (T, R, N, M, I, O), a title, author, and date of activity.

b)    Design and implement classes for specific types of media contributions: TV, radio, newspaper, magazine, and Internet.

a.    TV and radio activities would include the station of the broadcast, the time of the broadcast, and the name (type) of show, e.g. Evening News.

b.    Newspaper and magazine activities would include the name of the publication, and page number (s). Newspaper activities would also include a section (e.g. A).

c.    Internet activities would include the URL.

c)    Make sure to include necessary constructors, accessors & mutators (gets/sets), and toString methods for all classes.

d)    Design and implement a main class that

a.    reads the data from a file (media.txt) where the first field identifies the type of activity (T – TV, R – Radio, N – Newspaper, M – magazine, I – Internet). Each record consists of the data for the activity with each field separated by # (see Listing 5.11 on page 248-259).

b.    After reading in all of the data, your main class should print out all of the records in a nice format.

 

Sample Input

T#Online classes at CSU#Wayne Summers#July 6, 2008#WTVM#17:25#Five O’clock News

R#Half-time show#Coach Hayes#January 28, 2009#WDAK#17:45#Cougar Basketball

N#Neuromancer movie review#William Gibson#December 30, 2009#Columbus Ledger-Enquirer#D#12

M#Snowcrash book review#Neal Stephenson#October 8, 2004#SciFi Weekly#45

I#Wayne’s World#Wayne Summers#November 1994#http://csc.ColumbusState.edu/summers

 

EXTRA FEATURES

a)    Allow the user to select the file to read the data from.

b)    Allow the user to select one type of media (T – TV, R – Radio, N – Newspaper, M – magazine, I – Internet) and display only that type.

a.    Use keyboard selection

b.    Use JOptionPane

c.    Use drop-down list

c)    Sort the data by type before displaying.

d)    Sort the data by author’s name before displaying.

e)    Allow the user to select a field for sorting and then display the data sorted on that field.

(Due before class on Tuesday, February 10, 2009) Submit a .doc file containing the UML class diagram (showing inheritance for all the classes used in your program. [10 pts]

(Due before class on Tuesday, February 17, 2009) Submit your .java files containing your program to the dropbox in WebCT. [50 pts]

 Grades are determined using the following scale:

Grading Rubric  (Word document)