DOC PREVIEW
UNF COP 2551 - Study Notes

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

COP 2551 – Intro to OOPProgram #3Due: 16 July midnight (Friday) Drop dead time is 2:30pm, Monday, 19 JulyUsing NetBeans 6.8.1 you are to write a Java program using OOP principles to accommodate the following functionality Assignment #3Objectives:Provide student with opportunity in doing file input from an external file.Provide student with exercises in learning UMLProvide student with exercises in Javadoc and its various formatsProvide student with opportunity to create objects and develop a number of methods within their own objects Provide student with opportunity to use StringTokenizer, Substring, or other class / methods for tokenizing inputs (Check out the API link)Provide student with exposure to static attributes and static methods.Functionality:Overview: Using States.Small.txt, (an external file) on my web page and in Blackboard you are to do the following: You are to read data from an input file using the BufferedReader objects together with StringTokenizer, Substring, or other String methods (see the String class), create objects from each input line and display each of these objects to the screen. Once created, (bonus) you will prompt the user (me) for input and then search and retrieve identified objects via their country code. You will gain essential practical knowledge of Javadoc, as well as undertake architectural design (UML) and detail design (pseudo-code). Assignment does not include use of arrays. (Next assignment). 1. Download External File to Desktop. You are to access (download) a file named States.Small.txt of six records from my web page or from Blackboard (you may look at the file).2. External File access. For each line (record) read, you are to create an object of type State. (state attributes are state name, state capital, state code and state population. You should call the objects in your program state1, state2, etc. to enable easy grading for now. You will need to do file I/O to read the file. A link has been added to my web page with examples on how to do this and we will discuss in class. You will not be able to use a Scanner object for this, and you will need to use a Buffered Reader object. Once you read an entire line (record) from the file, you will need to parse it toobtain the individual items. You may do so using either StringTokenizer, or Substring (recommend the latter) or similar String method. Each time you create an object, you areto increment a static counter (public static int stateCounter) in the state class. (We will discuss, but they are found in the next chapter. You may also access the youTube videos. There is an excellent video on ‘static.’)3. Create Objects. Create one object per input record from the file. 4. Display State Objects. Once the objects are created, you are to display the state name, its capital and its population on your monitor. (Use commas for the population. This may be an interesting challenge.). Use a toString method which you should include in your State class to print out the name, capital and population. (toStringis discussed in your book and in an upcoming set of slides; there is also an excellent tutorial on youTube for toString() too.) Another example appears in the slides at the end of 5.1 on Coin myCoin code.Note: 5 and 6 are bonus features. I will add twenty points onto your program score if these are done correctly – AFTER the main functionality is provided.5. Search. Once this (you have created the objects and displayed them professionally) is done, you are to prompt the user (me) for a two-character state code. For simplicity, I will only submit valid state codes. You are to search each of the six stateobject to determine if the state code inputted matches a state code for a particular state object. When a match occurs, you are to display the message (left justified): (You may use Scanner for this part, if you wish.)Match found: Input: <my input – the state code> followed by the state name, the state capital, and its population each spaced out nicely on a single line. 6. Bonus continued. You should loop so that I can enter any number of country codes, one at a time. When I am done, I will enter the state code “zz” Then you are to skip a couple of lines and print out the number of state objects you created in the format: (left justified) Number of State Objects created is: <an integer>. You should also print out the number of state objects retrieved in response to my inputs in a similar format: Number of State Objects retrieved is: <an integer>. 7. UML. You are to include a UML design (your architectural design) showing object dependencies and object contents. Your book does a good job here. We will also discuss as needed.8. Pseudo-Code. You are to include your pseudo-code for your program logic in Main only. See examples on my web page. 9. Javadoc. ALL methods are to be preceded with Javadoc documentation and pay close attention to any parameters that might be needed. Be certain to documentthem. All methods are to have an @params and a @returns even if nothing is returned. You will only have a few in this program.10. I/O Note: You will need to import java.io and java.util.Scanner (for the interactive part of this assignment only). BufferedReader, FileReader, and IOException are in java.io and StringTokenizer, if used, is in java.util.*. We will discuss UMLYou are to include a UML class diagram. You may use Word or Power Point. No other technology may be used!Use the examples in your 2551 text. Each class listed in your UML diagram must have attributes listed (name, type). Methods must be shown with visibility indicator, and number /type of arguments plus the return type.Connect all classes (label the associations). ‘Drag’ your UML design file into your P3 subfolder within your COP2551 desktop folder. It will be included in the zip file to me.JavadocAll programming is to be accompanied by appropriate Javadoc as required above. Each class and each method in each class (object) must have appropriate documentation associated with it. Appropriate documentation for methods consists of a short description (single sentence) plus any parameters and any return types specified via @params and @return. Appropriate documentation for classes includes several sentences describing the purpose of the class. Include @author and any other documentation that assists indocumenting that particular class.


View Full Document

UNF COP 2551 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?