help java coding

Oct 11th, 2013
Anonymous
Category:
Calculus
Price: $20 USD

Question description

In this assignment you will use:  Classes and objects  Strings and their methods  User and text file I/O  Arrays of objects  Control Statements  Object passing in methods Create a Java Project “OswegoNote” which accepts citations from the input console (keyboard input) and holds them in an index. It also keeps track of which keywords are related to which citation. It should create an html file upon request with all the citations in the index in text form within the file are output formatted in one of three styles – ACM, IEEE or APA. It should contains four classes (each class must be a separate file) 1. Main 2. Citation 3. Index 4. Keyword Citation Class Attributes: 1. 2. 3. 4. 5. 6. 7. It 1. 2. ID‐int name ‐ string dateOfPublication – String publisher ‐ String wherePublisher ‐ string authors ‐ array of Strings[3] keywords ‐ array of Keywords[5] may also be useful to have internal variables to keep track of: numOfAuthors – (number of authors actually in the citation) numOfKeywords ‐ – (number of keywords actually in the citation) Methods 1. A constructor method that takes as input the name of the citation public Citation(String name) { this.ID = -1; this.name = name; this.dateOfPublication = "01/01/01"; } 2. An updateId(int ID) method that: a. Changes the ID of all the keywords of this citation from the old ID (this.ID) to the new ID (the parameter ID). This should be achieved by calling the changeID(int oldID, int newID) method of each of its keywords. b. Changes this.ID to the new parameter value ID. 3. Getters and Setters for all variables in the class. e.g. public void setName(String name) { this.name = name; } public String getName() { return this.name; } 3. Two methods addAuthor(String s) and addKeyword(String k) that add authors and keywords to the authors and keywords arrays respectively. (Note you must create a keyword object from the string to add to the citation’s keywords array) .These methods must first test to see if the maximum number of authors or keywords allowed is not violated before adding a new author or keyword. If there are already too many authors or keywords, it should print an error message. Keyword Class Attributes: 1. name ‐ string 2. citationIDs– array of ints[100] It may also be useful to have internal variables to keep track of: 1. numCitationIds – (number of citations in the index with that keyword) Methods 1. A constructor method that takes as input the name of the keyword and the ID of the citation public Keyword(String name, int ID) { } this.name = name; citationIDs[0] = ID; numCitationIDs++; 2. A method addID(int ID) addID(int ID) adds a new citation ID to the citationIDs array.  This method must first test to see if the maximum number of citationIDs allowed is not violated before adding a new citation ID.  If there are already too many citation IDs, it should print an error message. 3. A method changeID(int oldID, int newID)  This should search the ID array of the keyword for oldID and replace it with newID 4. Getter methods for keyword names and citationIDs arrays. E.g. public int[] getCitationIDs() { } Index Class return this.citationIDs; This class is an index of citations and as such holds an array of citations and an array of keywords related to them. The methods within this class comprise the bulk of the work of this assignment. An example of attributes used in this class is shown below. You may adapt this if you see fit but the functionality of the class must remain. Attributes: 1. citationIndex – array of Citations[number decided by user and < 50] 2. formatType – String (each index has a formatType) It may also be useful to have internal variables to keep track of: 1. numCitationsInIndex – (number of citations actually in the citationIndex) 2. totalNumCitations – (maximum number of allowed) Methods 1. A constructor method that takes as input the total number of Citations allowed public Index(int totalNumCitations) { } this.totalNumCitations = totalNumCitations; citationIndex = new Citation[totalNumCitations]; 2. A method: public int addCitation(Citation inCitation) This method must a. add a citation to the citationIndex. b. Call the updateId(int ID) a. The parameter ID should be the index of inCitation in the citationIndex array. 3. A setFormatType(String s) method that sets the format type of the index to ACM, IEEE or APA format and getFormatType() method that returns the current Format type as a string 4. Three methods that accept an input string of a file name and path and writes all the citations within citationIndex to the file formatted according to what is the current FormatType in Index: You will be using concatenation and substring methods to format these strings The formatACM() method must write to file all the citations in the citation index formatted as shown in the example below: Authors Title J. M. Cardoso and P. C. Diniz. Compilation Techniques for Reconfigurable Architectures. Springer, 2008. Publisher YearofPublication The formatIEEE() method must write to file all the citations in the citation index formatted as shown in the example below: Author(s) Title Year of Publication [1] Bailey, D.G., Design for Embedded Image Processing on FPGAs. 2011: Wiley. Citation ID Publisher The formatAPA() method must write to file all the citations in the citation index formatted as shown in the example below: Year of Author(s) Publication Title Calfee, R. C., & Valencia, R. R. (1991). APA guide to preparing manuscripts for journal publication. Washington, DC: American Psychological Association. Place of Publication Publisher Main Class This class instantiates a Scanner object that reads input from the user. You should : a. Ask the  b. Prompt       user how many citations they want as a maximum Create an Index object with this maximum number of citations the user for and accept as input: Name of Publication Date of Publication Authors (prompt for up to 3) Place of Publication Publisher Keywords (prompt for up to 5) c. Display the citation the user and ask if they wish to add it to their index If yes,  Create a Citation Object with these attributes using the appropriate methods to populate it  add the citation to the index If no, prompt for a new citation or quit d. when finished (quit option), ask the user which format they would like to use to save the index file (ACM, IEEE, APA)  Set the index format style accordingly e. Prompt the user for a file name and path to store the html output file.  Call the appropriate index method and store file

Tutor Answer

(Top Tutor) Studypool Tutor
School: Boston College
PREMIUM TUTOR

Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1830 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors