Via javafile

Via javafile










Microsoft Word - ACO102Ph1CompPgmAssign (1).docx 1 Arizona State University School of Mathematical and Natural Sciences ACO-102: Object-Oriented Programming Programing Assignment 03 Comprehensive Programming Assignment: Phase 1 150 Points Total • This assignment is an individual assignment. Collaboration with anybody or copying code from any source is strictly prohibited and will be treated as a violation of academic integrity policy. • Using IntelliJ IDE is recommended for this programming assignment. • Only programs that successfully compile and execute will be considered for assessment. • Your program must adhere to the UML specification • Your javadoc comments must be correct and complete and successfully generate an HTML document without warning. In this comprehensive programming assignment, you will combine the various components of the Java programming language that you learned this semester: • Inheritance & Interfaces & Abstract classes (Ch 9) • File Processing & Command Line Arguments & Exception Handling (Ch 7) The program will be based on observations of earthquakes. The earthquakes will be input using a text file in a comma-delimited format: dateTimeZ, latitude, longitude, magnitude, id, place The input file must be processed and validated. • dateTimeZ is a String representing the dateTime of the earthquake. (String: 24 characters in the format yyyy-mm-ddT##:##:##.###Z ) • latitude must be a valid latitude value (decimal: -90 to 90) • longitude must be a valid longitude value (decimal: -180 to 180) • magnitude represents the magnitude of the earthquake (decimal: -1.0 to 10.0) • id is the unique id assigned to the earthquake (String) • place is the location of the earthquake (String) Based on the values of the earthquake observations, an Earthquake will be created as either NonClassified or Classified. Please see the details of the UML diagram below and the following table, indicating the classification of the earthquake magnitude: Classification Minor Light Moderate Strong Major Great Magnitude 3-3.9 4-4.9 5-5.9 6-6.9 7-7.9 8 or more There will be three filenames that will be specified as command line arguments: java EarthquakeTester earthquakescsv.txt invalidInput.txt sortedEarthquakes.txt The first argument specifies the name of the input file, the second argument is the name of an output file that includes the invalid input with a line number and error message, and the last argument is an output 2 file name for printing out earthquakes in sorted order. The Earthquake class is to implement the Comparable interface such that earthquakes are sorted in decreasing earthquakes magnitude. A toString method that displays the class name and all of its attributes, including inherited ones must be available on each class - see the UML diagram. (Use the approach specified in Special Topic 9.6 Inheritance and the toString Method - page 468) The EarthquakeTester.java file will process the input file, populating an ArrayList with valid earthquakes, sort the ArrayList, and write the sorted earthquakes to the output file using the toString of the Earthquake. Submit the following deliverables on the assignment page on Canvas: 1) An electronic copy of your .java files. Your Java files should not include a package statement. 2) A copy of output files generated by your program, including: a. The invalidInput.txt file which includes error messages for invalid earthquake records generated by your program. This file should include error messaged generated for all three record error scenarios explained later in this document. b. The sortedEarthquakes.txt file generated from the earthquakeSampleCSV.txt file provided with this assignment. This file includes 257 valid earthquake records. 3) A PDF file named CompProgAssignPh1.pdf containing snapshot of your java files, and snapshot of generated Java Doc HTML file. At the top of the pdf file include your name, the course (ACO-102) and the assignment (CompProgAssignPh1). The File Summary below includes the list of Java files for this assignment. Java File Summary Java File Overview Description Earthquake.java Abstract superclass implements Comparable; contains common earthquake attributes NonClassified.java Subclass of Earthquake Classified.java Subclass of Earthquake contains an additional magnitude Class attribute EarthquakeTester.java main handles command-line arguments and prints a command usage message if all three command arguments are not provided. handles FileNotFoundException if the input file is not valid and prints a message to the user. 3 Command line processing: If the command line is not in the correct format, display the correct usage of the command on the terminal and terminate the program. Use the CeasarCipher.java program (textbook pages 346-347) as a model. If an invalid input file name is provided display a message saying file is not found and terminate the program. Input File: The earthquakeSampleCSV.txt file is provided on the assignment page. This file includes valid data for all the records. Use this file for testing with valid data. Create your own test data for invalid test cases to test for the following cases: o Number of fields: too many or too few o dateTimeZ: 24 characters; wrong format o latitude, longitude, magnitude: wrong format or out of range 4 Output Files: 1) Error File When reading the input file if any line (earthquake record) is invalid, display a line that includes the invalid input with a line number and error message. 2) Sorted Records File List of earthquake recodes in sorted order. Include all the attributes of the records in the sorted listing. Incremental Development Suggestions: 1. Implement the inheritance hierarchy that illustrates the correctness of your implementation by creating a collection of earthquakes (make sure that you include all types) by hardcoding the values and displaying the content of that collection in sorted order. 2. Add the command line arguments for files and process the data per the specification. Make sure that the program first works on valid input and then extend to handle data validation. Rubric: Only programs that successfully compile and execute will be considered for assessment. File Points Comments Earthquake.java 5 Must include Javadoc Comments NonClassified.java 5 Must include Javadoc Comments Classified.java 5 Must include Javadoc Comments EarthquakeTester.java 20 Up to 10 points will be deducted for poor code quality. Code must be well structured and easy to read and understand. Use the following best practices: 1. Use descriptive variable names 2. Use functional abstractions to modularize your code 3. Comment your code to improve readability. invalidInput.txt 6 Must include all three record error scenarios. For each missing error scenario 2 points will be deducted. sortedEarthquakes.txt 9 Must include list of 257 earthquake recodes in sorted order. CompProgAssignPh1.pdf 50 Up to 2 points will be deducted for each one of the missing or incorrect JavaDoc for classes EarthQuake, NonClassified, and Classified.
Apr 10, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here