1. Homepage
  2. Programming
  3. CIT 5940 Data Structures & Software Design - Module 7 Programming Assignment CSV Slicer

CIT 5940 Data Structures & Software Design - Module 7 Programming Assignment CSV Slicer

Engage in a Conversation
University of PennsylvaniaUPennCIT 5940CIT5940Data Structures & Software DesignCSV SlicerJava

CIT 5940 - Module 7 Programming Assignment CSV Slicer CourseNana.COM

Contents CourseNana.COM

CSV Slicer CIT 5940 - Module 7 Programming Assignment Assignment Overview
CourseNana.COM

In this assignment you will read files in a format known as "comma separated values" (CSV), interpret the formatting and output the content in the structure represented by the file. CourseNana.COM

Learning Objectives CourseNana.COM

Implement a method to extract content from an input CSV
Read and understand a formal specification for the CSV format Use a "state machine" CourseNana.COM

Advice CourseNana.COM

We highly encourage you to utilize the course discussion forum to discuss the project with class- mates and TAs. Before asking the question, please search in the forum to see if there are any similar questions asked before. Please check all suggestions listed there. CourseNana.COM

For this and all other assignments in this course, we recommend that you work on your local computer using an integrated development environment (IDE) such as Eclipse, IntelliJ, Visual Studio Code, or whatever IDE you used for any prior Java courses that you are familiar with. Although you will need to upload your solution to Codio for grading (see the Submission Section below) and could develop your solution on that platform, we recommend using industry standard tools such as Eclipse or IntelliJ so that you become more used to them and can take advantage of their features. CourseNana.COM

If you have trouble setting up your IDE or cannot get the starter code to compile, please post a note in the discussion forum and a member of the course staff will try to help you get started. CourseNana.COM

We expect that you will create your own JUnit tests to validate your solution before submission. CourseNana.COM

CSV Slicer CIT 5940 - Module 7 Programming Assignment 1 Setup CourseNana.COM

  1. Begin by downloading the CIT594-csv.zip archive from Canvas, then extract the con- tents. The main file you will work in is CSVReader.java. This contains the unimplemented methods for the code that you will write in this assignment. CourseNana.COM

  2. Compile this code before making any changes. This will ensure your local environment is configured correctly. CourseNana.COM

  3. Review the current implementation. You’ll want to understand the various parts of the code and how they work together before making changes! CourseNana.COM

2 Requirements CourseNana.COM

2.1 Structure and Compiling CourseNana.COM

  1. You MUST use a JDK version of 17 or higher. CourseNana.COM

  2. You MAY use a JDK version higher than 17, but you MUST set the Java language level to 17 for compatibility with Codio. CourseNana.COM

  3. You MUST NOT change any of method signatures for any of the provided methods. This includes the parameter lists, names, and return value types, etc. CourseNana.COM

  4. You MUST leave all classes in the default package. CourseNana.COM

  5. You MUST NOT create additional .java files for your solution. CourseNana.COM

  6. You SHOULD create JUnit tests to help validate your code. These tests SHOULD NOT be a part of your solution. We do expect you to test your code thoroughly with JUnit tests before submission. CourseNana.COM

  7. You MUST follow our directives in the starter code comments. This means if we ask you to not change a variable’s value, you MUST NOT change that variable’s value. CourseNana.COM

  8. You MAY create additional helper functions, as long as they meet the other requirements of the assignment (e.g. doesn’t crash with invalid inputs, etc.). CourseNana.COM

  9. You MUST fill out the required Academic Integrity signature in the comment block at the top of your submission files. CourseNana.COM

CSV Slicer CIT 5940 - Module 7 Programming Assignment CourseNana.COM

Functionality Specifications CourseNana.COM

General Requirements CourseNana.COM

Your method MUST NOT crash if a user enters an invalid input. Remember you do not have control over what a user inputs as arguments. For example, all methods should handle null inputs gracefully. CourseNana.COM

You MAY add supporting fields and helper methods to the CSVReader object as needed. CSV Format CourseNana.COM

CSV is a common delimited text format for storing and transmitting tables. The name comes from the fact that it separates fields with the comma character (rows of the table are separated by line breaks). CourseNana.COM

To support values in the fields that include delimiter characters (for example, if a comma is part of the data, not just a field separator) requires some added complexity. However, there is not a single specification for the CSV format, so we will use one specific format for this assignment, RFC 4180. To simplify the assignment, we will relax some of the rules. CourseNana.COM

  1. You MUST follow the specification in section 2 of RFC 4180, unless otherwise specified here. CourseNana.COM

  2. RFC 4180 Rule Clarification:
    Formatting characters describe structure; they are not part of the field content. For example,
    CourseNana.COM

    the comma that separates two fields MUST NOT be included in either field: CourseNana.COM

        "example of using "" in a field",1
    

    MUST result in a single row that is equivalent to an array constructed with the Java expres- sion CourseNana.COM

        new String[] { "example of using \" in a field", "1" };
    
  3. RFC 4180 Rule Clarification:
    Escape characters in an escaped field follows the above rule. Two double quotes in the middle
    CourseNana.COM

    of an escaped field count as a single double quote character in the content. CourseNana.COM

  4. RFC 4180 Rule Clarification: CourseNana.COM

    Regarding RFC 4180, Section 2, Rule 2, there is no additional record if the file ends at the start of a line. This includes, but is not limited to, the example in RFC 4180, Section 2, Rule 1, where the file ends with CRLF EOF. CourseNana.COM

CSV Slicer CIT 5940 - Module 7 Programming Assignment CourseNana.COM

  1. RFC 4180 Rule Adjustment: CourseNana.COM

    You MUST use these additional rules that modify RFC 4180, Section 2, Rule 4. CourseNana.COM

    1. (a)  Do not apply special treatment to the first row. You MUST NOT treat a header row differently than a record row. CourseNana.COM

    2. (b)  You do not need to check if all rows have the same number of fields. CourseNana.COM

    3. (c)  Commas at the end of a line signify empty fields. For example CourseNana.COM

      a,b,c, CourseNana.COM

      results in a row with four fields1: [ "a", "b", "c", "" ] CourseNana.COM

    4. (d)  An empty line terminated by a line break is a valid row if it is outside an escaped field. Inside an escaped field, it is just part of the content of that field CourseNana.COM

  2. RFC 4180 ANBF Grammar Adjustment:
    CRLF = [CR] LF
    This change makes carriage return optional everywhere CRLF is used. CourseNana.COM

  3. RFC 4180 ANBF Grammar Adjustment:
    TEXTDATA = %x00-09 / %x0B-0C / %x0E-21 / %x23-2B / %x2D-7f CourseNana.COM

    This change expands TEXTDATA2 to all characters that are not comma, double quote, carriage return, and line feed. CourseNana.COM

  4. For the purposes of the assignment there are five classes of characters for you to consider: CourseNana.COM

Common Name Line Feed Carriage Return Double Quote Comma Anything Else CourseNana.COM

RFC Name LF
CR DQUOTE COMMA TEXTDATA
CourseNana.COM

RFC Code (hex) Decimal Java Character %x0A 10 \n %x0D 13 \r %x22 34 " CourseNana.COM

%x2C 44 , [^\r\n,"]3 CourseNana.COM

1The line in rule 4 in RFC about "The last field in the record must not be followed by a comma" is referring to their rule that each line should contain the same number of fields. A comma at the end of a line would insert an additional, empty field. The statement indicates that an extra comma that would increase the number of fields beyond the expected limit should not be dropped or ignored. CourseNana.COM

2We will not test with characters above %x7F (127), but you are welcome to include %xFF-7FFFFFFF (Integer.MAX_VALUE) in TEXTDATA if you wish. That will cover many more special characters and allow you to process Unicode values. CourseNana.COM

3This is just a regular expression to write any other character aside from the four listed. CourseNana.COM

CSV Slicer CIT 5940 - Module 7 Programming Assignment 2.2.3 readRow method CourseNana.COM

Your implementation will all be in this method. CourseNana.COM

  1. Each call to readRow MUST return one row of data from reader until the input is ex- hausted CourseNana.COM

  2. If there is a format error in the input, you MUST raise a CSVFormatException. You MAY use the optional fields to report informative error messages for debugging purposes, but we will not evaluate them. CourseNana.COM

  3. The runtime MUST be O(n), where n is the number of characters in the input. Choose your data structures carefully: seemingly convenient operations and data structures may not be appropriate for this assignment. CourseNana.COM

  4. You MUST process the input one character at time (hence the provided CharacterReader which is more restricted than the standard Java.io.Reader. You may wish to organize your code in a "state machine", detailed in the supplemental reading. CourseNana.COM

2.3 Writing Test Cases CourseNana.COM

Upon completion of each functional requirement, always conduct thorough testing of the corre- sponding functions. Consult the guidelines on composing JUnit tests and creating test cases in Module 1. You MUST develop JUnit tests for every implemented function. This testing component carries a weight of approximately 5% towards the total assignment score. CourseNana.COM

3 Submission CourseNana.COM

3.1 Pre-submission Check CourseNana.COM

Before you submit, please double check that you followed all the instructions, especially the items in the Structure and Compiling section above. CourseNana.COM

3.2 Codio Submission CourseNana.COM

  1. When you are ready to submit the assignment, go to the Module 7 Programming Assignment Submission item and click the button to go to the Codio platform. CourseNana.COM

  2. Once you are logged into Codio, read the submission instructions in the README file. This should be the first thing that appears in the window. CourseNana.COM

  3. Upload your solution and any JUnit test files to the "submit" folder. CourseNana.COM

  4. In the menu bar, select Run JUnit Tests. This will run any unit test files that you have uploaded with your submission. Note that there are no pre-submission checks provided. However you can use this feature as a basic validation check to be sure your code compiles. CourseNana.COM

CSV Slicer CIT 5940 - Module 7 Programming Assignment CourseNana.COM

  1. When you’re ready to submit, go to Education and select Mark As Completed. Confirm at CourseNana.COM

    the prompt. CourseNana.COM

  2. You will see quite a bit of output, even if all the tests pass. At the bottom of the output, starting at YOUR AUTOGRADING RESULTS BELOW you will see the number of successful and failed test cases. CourseNana.COM

  3. If you want to update your code and resubmit, for example if you did not pass all of the tests, un-mark the assignment as complete. You will then be able to edit your code, run your JUnit tests, and resubmit. CourseNana.COM


CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
University of Pennsylvania代写,UPenn代写,CIT 5940代写,CIT5940代写,Data Structures & Software Design代写,CSV Slicer代写,Java代写,University of Pennsylvania代编,UPenn代编,CIT 5940代编,CIT5940代编,Data Structures & Software Design代编,CSV Slicer代编,Java代编,University of Pennsylvania代考,UPenn代考,CIT 5940代考,CIT5940代考,Data Structures & Software Design代考,CSV Slicer代考,Java代考,University of Pennsylvaniahelp,UPennhelp,CIT 5940help,CIT5940help,Data Structures & Software Designhelp,CSV Slicerhelp,Javahelp,University of Pennsylvania作业代写,UPenn作业代写,CIT 5940作业代写,CIT5940作业代写,Data Structures & Software Design作业代写,CSV Slicer作业代写,Java作业代写,University of Pennsylvania编程代写,UPenn编程代写,CIT 5940编程代写,CIT5940编程代写,Data Structures & Software Design编程代写,CSV Slicer编程代写,Java编程代写,University of Pennsylvaniaprogramming help,UPennprogramming help,CIT 5940programming help,CIT5940programming help,Data Structures & Software Designprogramming help,CSV Slicerprogramming help,Javaprogramming help,University of Pennsylvaniaassignment help,UPennassignment help,CIT 5940assignment help,CIT5940assignment help,Data Structures & Software Designassignment help,CSV Slicerassignment help,Javaassignment help,University of Pennsylvaniasolution,UPennsolution,CIT 5940solution,CIT5940solution,Data Structures & Software Designsolution,CSV Slicersolution,Javasolution,