Lab 1460 - Shelby County Marriages

Description

In this lab, you will use an array to tabulate and display the number of marriages, by month, recorded in Shelby County, Kentucky from 1792 to 1800.

Overview

You will be provided with a list of marriages from Shelby County, Kentucky from 1792 to 1800. The data file is available below and the format is as shown here for the first few entries of the list:

Shelby County Kentucky Marriages 1792 - 1800

Adams, Nancy            Bonta, Henry              2/09/1799
Adcock, Edmond          Ford, Mary               28/11/1794
Admire, George          Leck, Sarah               2/06/1800
Akers, Polly            Ashby, Thomas            19/02/1779
Alexander, Benjamin     Williams, Betsy          26/08/1798
Allen, John             Logan, Jean              19/10/1799
Allen, Martha           Patterson, Arthur        24/05/1798
Allen, Winney           Huckleberry, Jacob       20/01/1795
Allison, Easter         Ferguson, William        21/07/1795

After the first two lines, each line lists the people being married and the date of their marriage.

Assignment

Write a program to display the marriages from the data file by month to see when most marriages occured. You may be surprised by the answer.

This project used the Model-View-Controller design pattern. Your teacher will provide code for the View and the Controller components. You must write the missing parts of the model class.

The file ShelbyModel.java is provided to you looking like this:

/**
        this is student code, in particular the solve method
        in this lab, it just reads the data and populates the 1D array.
        results are displayed for the student by calling myView.updateView()
 */

public class ShelbyModel
{
    private int monthData[];
    private ShelbyView myView;
    private String dataFile;
        
    public ShelbyModel ( String filename, ShelbyView view )
    {
        myView = view;
        dataFile = filename;
    }
        
    public void solve()
    {    
    ... student code here ...
    myView.updateView(monthData);               // for each month
    }
}

You will be provided with the controller: Shelby.java, and the view component: ShelbyView.java. These files, along with EasyReader, can be used without modification to complete this project. You also need the marriage records data file.

The result will be presented in a bar graph similar to the one shown below, though the actual Shelby County Marriage data will produce a different result.

Shelby bar graph
Copyright © 2010 by Asylum Computer Services LLC Return to CS Labs