2551.p4.Fall2010

2551.p4.Fall2010 - COP 2551 Introduction to OOP Program #4...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 2551 – Introduction to OOP Program #4 Due: Wednesday, 17 Nov 2010 start of class Drop dead: Monday, 22 Nov 2010 start of class. Using NetBeans 6.8, you are to write a Java program using OOP principles to accommodate the following functionality Assignment #4 Objectives : Provide student with experience building arrays of objects Provide student with opportunity in doing file input and output. Provide student with exercises in learning UML Provide student with exercises in Javadoc and its various formats Provide student with exercises in searching and traversing the array of objects. Functionality: Using the external file States.txt , you are to do the following: 1. Build an array of State objects. You are to develop a class named State from an external file, BigStates.Fall2010, and create as many objects of this type – one object for each record (line) from the input file. Allocate your array size to the number of input strings, which I believe is 33. While you may look at the file and its contents, do not ‘read in’ the exact number of states as lines, as I may test your program with a different file with a different number of states. You are not to alter the data, however, in any way.) Each state object will have properties as shown and defined individually as Strings, ints, or whathaveyou, as appropriate for each state object. Hint: you may use substring method in class String to parse as expected. Please note that the first several lines provides the layout of the data below. When you Save Target As to download this state file, you may eliminate those first lines. But you need the layout of information in your program in order to parse. Thus, only save into your project area a download of the data lines. 2. Display files Requirement . From main() you are to write code to display the array of objects to the screen – you must use toString(). This is to include a nice looking header spanning (spread out) the display line followed by nicely spaced columns of state attributes aligned under their respective header. Text data is to be left justified; numeric data, always right justified with commas as appropriate.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3. Copy the array of objects to an external file to BigStatesOut.Fall2010. See slides for example. You will need FileWriter and appropriate methods as found in the slides. For the file output, only write the records.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

2551.p4.Fall2010 - COP 2551 Introduction to OOP Program #4...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online