2551.p4.Summer2011

2551.p4.Summer2011 - COP 2551 Introduction to OOP Program...

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, August 3 rd , 2011 – midnight Drop dead: Thursday, August 4 th , 2011 - midnight Using NetBeans 6.9 or later version 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 and create as many objects of this type one object for each record (line) from the input file. (Take a look at the file. The first several lines describe the relative positions of the data underneath. You may eliminate those lines and start reading from Washington, etc. When you Save Target As to download this state file, you may eliminate those first lines at that time. But you need the information in your program in order to parse. Thus, only process the data lines. 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 two lines provide the layout of the data below. 2. Display files Requirement . From main() you are to write code to display the array of objects to the screen – recommend using toString(). This is to include a nice looking header spanning 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. 3. Copy the array of objects to an external file too, and name the output file, outStates.txt . See slides for example. You will need FileWriter and similar classes / objects.
Background image of page 1

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

View Full DocumentRight Arrow Icon
For the file output, only write the records. No header line. So the individual lines should look like what you display in #2 above – nicely spaced out; no header. 4.
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.

This note was uploaded on 07/26/2011 for the course COP 2551 taught by Professor Roggio,r during the Summer '08 term at UNF.

Page1 / 5

2551.p4.Summer2011 - COP 2551 Introduction to OOP Program...

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