Question: Your program will read the WA _ EV _ Population.csv file a text file in which data fields are separated by comma. The explanation of

Your program will read the WA_EV_Population.csv filea text file in which data fields are separated by comma. The explanation of data is not needed because you can understand data from header line. The data file will be organized as follows: The first row consists of column headers and should be ignored while processing data but needs to be considered for data types and what each data means. The remaining lines of the file contain the data. Each data row contains data on an EV record. Your EV program will not know in advance the number of data rows present in the file. However, for this homework, you only need to read, process, and output one line at a time, so it should not be necessary for EV program to know the total number of rows in advance.
As EV program reads the data file, there are two operations that must be made about data. First, you need to check whether each record (each row) is unique (not repeated). If EV program encounters a duplicate record/row while reading the data file, it must provide an error message indicating that it encountered a duplicate and the line number at which the duplicate was found, then move on to reading, processing, and outputting the next line in data file. The exact format of the error must be as follows:
Duplicate at line n.
n should be replaced by the line at which duplicate was found, counting the first data line (not the header line) as line 1. Lines at which duplicates are encountered do increment the line count.
Second, if the record/row is not a duplicate, the EV program should verify that all values in the data are
valid and does not include any unknown or ? values. Moreover, the data should not have any negative values for Electric Range, Base MSRP, and Legislative District. Additionally, Vehicle Location must be in the border of WA State. If any of the values are not valid, the EV program must provide an error message indicating that it encountered an invalid data value and the line number at which the invalid data was found, then move on to reading, processing, and outputting the next line in data file. The exact format of the error must be as follows:
Invalid data at line n.
n should be replaced by the line at which the invalid data was found, counting the first data line (not the header line) as line 1. Lines at which invalid data is encountered do increment the line count, but do not have their record/row added to list of unique rows already read in.
As the data is read in, line by line, and processed to check for duplicates and invalid values, the EV program will send it back out again, albeit in a slightly altered form. Rather than comma separated, the output data will be separated by semicolon. Lines containing duplicate records/rows or invalid data values will not be output, only errors messages will be output for those lines. It is important to note that the header line must be printed at the top by separating with semicolon.
Implementation Issues:
You must create and submit Java source code to complete this homework (as well as all other homework in this course). You will use the standard Java input and output streams (System in and System out, respectively) for all input and output for this assignment. To test your code on the data file, you will want to tell CSV file that you wish to redirect with BufferedReader or Scanner to read from your data file.
Note that this homework does not require you to create any classes or to use object-oriented design at all. In fact, you dont even need to create any methods except the main method. Nonetheless, you must use good programming style and documentation, including making your code modular, using explanatory comments for each section of code, using meaningful variable and method names, using consistent indentation, etc.
You may write your program from scratch or may start with programs for which the source code is freely available on the web or through other sources (such as friends or student organizations). If you do not start from scratch, you must give a complete and accurate accounting of where all of your code came from and indicate which parts are original or changed and which you got from which other source. Failure to give credit where credit is due is academic fraud and will be dealt with accordingly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!