Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simple JavaFX only, please. HWO2 - Binary and CSV (Text) I/O Problem Statement: An extract of some names and personal information has been made from

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedSimple JavaFX only, please.

HWO2 - Binary and CSV (Text) I/O Problem Statement: An extract of some names and personal information has been made from a baseball database. This assignment is to read the data from a comma separated value text file (CSV), write the data into a binary file, then read it back in writing the data to the screen showing that the data in the binary file is intact and correct. You must implement the following GUI: 375x400 Baseball Putri btnOpen FileName trecordsout Recordsin tata Font MONOSPACED, 12 point When the user clicks the Open button, display a FileChooser that shows CSV files in the current directory and let the user choose one. You will create a similarly named.dat file. Example: Given filename BaseballNames2.csv, the output file is named BaseballNames2.dat. Input Datafile layout: TWO CSV datafiles have been provided for testing, Baseball Namesi.csv and BaseballNames2.csv. Each contains a header line as the first line of the file. A blank line may or may not follow. Your program must account for either a blank or non-blank line (record) regardless of what the sample file shows. The program must also account for leading and trailing spaces or tabs in the data (see the String method trim for help with this), along with various errors. The file layout is as follows: Field name First Name Last Name Birth Day Birth Month Birth Year Weight Height Data type Text Text Whole number Whole number 4-digit year Whole number Number with decimal part File BaseballNamesi.csv contains no errors, and your program must be able to process this one cleanly before you move to the next datafile. File BaseballNames2.csv may have a value for each expected field or may not. Since this was a database extract, some missing (null) fields show up in the data. Some records may have one or more missing fields. Write errors to the taData text area and only valid records to the.dat file. When an error is encountered in a line read in from the CSV, write the line and first error found to taData. Then continue to process the rest of the file. Your program will then read your created *.dat data file and print it to taData. Reporting multiple errors per record is a bonus, described below. Correctly writing the above with Javadocs, can gain you full credit for this homework. My Solution Together with the two csv files, the Downloads for HWO2 include a jar file for my solution called BaseballA.jar. You can run this to see how your program should run. The bonuses are not provided in this solution. The program Baseball B.jar is my solution with the bonus levels (both of them) in place. Output datafile layout: The binary output (dat) file must have the fields in the same order as the input. No headings are written in the output file, only the data. The appropriate binary I/O data types must be used, text must be written as text, numbers must be written as the appropriate numeric data type. You must use the appropriate methods of DatalnputStream and DataOutputStream for all I/0 to the ".dat" file. Output report: At the end of reading the csv file, and writing the dat file, display how many records were read from the csv file in tfRecordsin and how many records were written to the dat file in tfRecordsOut. Remember to count the heading and blank lines as records read in, but not written out. Similarly, records with errors are records read in but not written out. Use formatted printing, so the output report looks impressive Spacing does not have to be exactly as shown, but it should be close. Hints: Dates are provided in the western format of "month, day, year". I suggest getting BaseballNamesi.csv to work first. Save a backup copy of the code, then start on BaseballNames2.csv. Make sure you hand in something before the due date. Any bonus points won't make up for the late deductions. Sample outputs: BaseballNames1.csv - no errors. Use this for initial testing only. . File: Baseball - D. Petric BasebalNames.com Cpon Recorusin 22 Records Out Punt ut ne Rirthdate with Strain Cut 1/24/2010 190 Madison Dag 0/1/12 TL.0 B/9/1989 240 Des de 10/22/2009 160 10/11/1989 160 Janety Mejia 72.5 Mike Banten 11/8/1989 3/10/1989 240 71.1 Chris 8.1 3/30/1999 170 9/19/109 225 Clayton Kerah 2/19/10 225 TERUS Onder 2/2/15 225 Elvis Andrus 1/24/2010 Tavs Cell 3/1/2014 16.0 There are more lines than are shown here, as indicated by the vertical scrollbar. Single error reported per record (BaseballNames2.csv). Baseball - D. Patric Fle: Deseta2. Open Records in 16 Record Out 4 ottanding itan is: liet Eu Sounds Dtanding itan is: Weiget Ecco found in Hat + lates mall.nl onding it in with Sint East Birthste Wocht ght 3/20/11 Ryan sa Csezon Maybe 95.0 Josh Husk 5/1/1997 2/19/1587 Multiple errors reported per record (BaseballNames3.csv) and record with insufficient fields. Baseball - D. Patris Bere. Records in: 20 Records Out: 2 Eco County Deding daar Rrror found Dhaivan Martin Ording data En todos Ryan Not enough tselda in the record. CEED toedin: Ofreding data: EREDE Eod in San offering alat Errending data Rxror found in Josh Reddick Ording data: null, mul + Teat. Laat name Hyan Kalish Conor Cillie Bizthdate weight light 3/28/1588 205 73.2 7/18/1987 200 Beginning output is omitted to show end result. HWO2 - Binary and CSV (Text) I/O Problem Statement: An extract of some names and personal information has been made from a baseball database. This assignment is to read the data from a comma separated value text file (CSV), write the data into a binary file, then read it back in writing the data to the screen showing that the data in the binary file is intact and correct. You must implement the following GUI: 375x400 Baseball Putri btnOpen FileName trecordsout Recordsin tata Font MONOSPACED, 12 point When the user clicks the Open button, display a FileChooser that shows CSV files in the current directory and let the user choose one. You will create a similarly named.dat file. Example: Given filename BaseballNames2.csv, the output file is named BaseballNames2.dat. Input Datafile layout: TWO CSV datafiles have been provided for testing, Baseball Namesi.csv and BaseballNames2.csv. Each contains a header line as the first line of the file. A blank line may or may not follow. Your program must account for either a blank or non-blank line (record) regardless of what the sample file shows. The program must also account for leading and trailing spaces or tabs in the data (see the String method trim for help with this), along with various errors. The file layout is as follows: Field name First Name Last Name Birth Day Birth Month Birth Year Weight Height Data type Text Text Whole number Whole number 4-digit year Whole number Number with decimal part File BaseballNamesi.csv contains no errors, and your program must be able to process this one cleanly before you move to the next datafile. File BaseballNames2.csv may have a value for each expected field or may not. Since this was a database extract, some missing (null) fields show up in the data. Some records may have one or more missing fields. Write errors to the taData text area and only valid records to the.dat file. When an error is encountered in a line read in from the CSV, write the line and first error found to taData. Then continue to process the rest of the file. Your program will then read your created *.dat data file and print it to taData. Reporting multiple errors per record is a bonus, described below. Correctly writing the above with Javadocs, can gain you full credit for this homework. My Solution Together with the two csv files, the Downloads for HWO2 include a jar file for my solution called BaseballA.jar. You can run this to see how your program should run. The bonuses are not provided in this solution. The program Baseball B.jar is my solution with the bonus levels (both of them) in place. Output datafile layout: The binary output (dat) file must have the fields in the same order as the input. No headings are written in the output file, only the data. The appropriate binary I/O data types must be used, text must be written as text, numbers must be written as the appropriate numeric data type. You must use the appropriate methods of DatalnputStream and DataOutputStream for all I/0 to the ".dat" file. Output report: At the end of reading the csv file, and writing the dat file, display how many records were read from the csv file in tfRecordsin and how many records were written to the dat file in tfRecordsOut. Remember to count the heading and blank lines as records read in, but not written out. Similarly, records with errors are records read in but not written out. Use formatted printing, so the output report looks impressive Spacing does not have to be exactly as shown, but it should be close. Hints: Dates are provided in the western format of "month, day, year". I suggest getting BaseballNamesi.csv to work first. Save a backup copy of the code, then start on BaseballNames2.csv. Make sure you hand in something before the due date. Any bonus points won't make up for the late deductions. Sample outputs: BaseballNames1.csv - no errors. Use this for initial testing only. . File: Baseball - D. Petric BasebalNames.com Cpon Recorusin 22 Records Out Punt ut ne Rirthdate with Strain Cut 1/24/2010 190 Madison Dag 0/1/12 TL.0 B/9/1989 240 Des de 10/22/2009 160 10/11/1989 160 Janety Mejia 72.5 Mike Banten 11/8/1989 3/10/1989 240 71.1 Chris 8.1 3/30/1999 170 9/19/109 225 Clayton Kerah 2/19/10 225 TERUS Onder 2/2/15 225 Elvis Andrus 1/24/2010 Tavs Cell 3/1/2014 16.0 There are more lines than are shown here, as indicated by the vertical scrollbar. Single error reported per record (BaseballNames2.csv). Baseball - D. Patric Fle: Deseta2. Open Records in 16 Record Out 4 ottanding itan is: liet Eu Sounds Dtanding itan is: Weiget Ecco found in Hat + lates mall.nl onding it in with Sint East Birthste Wocht ght 3/20/11 Ryan sa Csezon Maybe 95.0 Josh Husk 5/1/1997 2/19/1587 Multiple errors reported per record (BaseballNames3.csv) and record with insufficient fields. Baseball - D. Patris Bere. Records in: 20 Records Out: 2 Eco County Deding daar Rrror found Dhaivan Martin Ording data En todos Ryan Not enough tselda in the record. CEED toedin: Ofreding data: EREDE Eod in San offering alat Errending data Rxror found in Josh Reddick Ording data: null, mul + Teat. Laat name Hyan Kalish Conor Cillie Bizthdate weight light 3/28/1588 205 73.2 7/18/1987 200 Beginning output is omitted to show end result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago

Question

3. What strategies might you use?

Answered: 1 week ago