Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java ( ALL CODE PLEASE ) Create a Netbeans project using the standard naming convention. Objective: For this assignment you will be reading data

In Java (ALL CODE PLEASE) Create a Netbeans project using the standard naming convention.
Objective:
For this assignment you will be reading data from a variety of files, verifying that the data is correct, and writing the data out to an output file in a new format.
Your input data will be a series of ASCII text files stored in various subdirectories on a file system. You will need to read data in from each of these files. You will not know in advance the names or locations of the files and your program will need to ask the user for the absolute path of the starting directory. All of the data files that you need to process will be stored either in the starting directory or in the directories underneath the starting directory.
The data files contain auction results for various U.S. Treasury Securities. This data will be structured data stored in a blank delimited fashion.
The data files will fall into three categories:
Bills Information of Treasury Bills (T-Bills)
Bills mature in less than one year.
Filename for Bills will have the form: T-Bills-20240210.txt
Notes Information on Treasury Notes
Notes mature in 2 to 10 years
Filename for Notes will have the form: Notes-20240210.txt
Bonds Information on Treasury Bonds
Bonds Mature in 20 or 20 years
Filename for Bonds will have the form: Bonds-20240210.txt
In the above filename examples, the numbers after the security type indicate the date the information was downloaded in a YYYYMMDD format.
Each of the data files will begin with a header line indicating the data fields for each row (record) in the file.
T-Bill have six fields
Security Term - the duration of the T-bill in weeks
CUSIP a unique identification number
Issue Date date the bill is issued
Maturity Date date the bill matures
Hight Rate the interest rate of the bill
Investment Rate the investment rate of the bill
Notes and Bonds each have seven fields
Security Term the duration or the bill or bond
CUSIP a unique identification number
Reopening a yes/no field
Issue Date date of the bill or bond is issued
Maturity Date date the bill or bond matures
Hight Yield the interest rate of the bill or bond
Interest Rate the investment rate of the bill or bond
For each security type your program will need to:
Read in all of the data files for that type
Write out a single data file for that type
Each output file should have a csv file extension
e.g. when processing all the T-Bill files the single output file should be T-bills.csv
The output file should begin with a single header row that matches the header row from the input files except each header in the output file should NOT contain any blank spaces
e.g.Issue Date should be output as IssueDate
Once the user enters a valid starting directory your program should:
Process all files in the starting directory all subdirectories
For each file your program should process each record excluding the header record.
For each valid row in a data file your program should write a reformatted row to the output file.
If a row is not valid that row should be written to an error file.
When processing a record your program should:
Verify that each row contains the correct number of fields/tokens
Verify that each field contains data of the appropriate type
If the record/row appears to be valid you should write a corresponding record to an output file named T-Bill.csv, Notes.csv or Bonds.csv as appropriate.
If a record/row appears to be invalid that record/row should be written to an error file named errors.csv
There should be a single error file that is used by all security types.
The output files (T-Bill.csv, Notes.csv, and Bond.csv) should each have:
A single header row (column label row) where the column labels do not contain any embedded blank spaces.
e.g.Issue Date becomes IssueDate
For the data rows
Security type in the output file should be the same as the Security type in input file
e.g.4-Week should stay 4-Week
CUSIP should rename the same
Reopening should remain the same
The T-Bill data does NOT have a reopening field
IssueDate and MaturityDate should be changed
Input data has a date format of mm/dd/yyyy
Output data should have date format of yyyymmdd
e.g.02/13/2024 becomes 20240213
HighRate and InvestmentRate should be changed
Input data is in % format
Output data should be in decimal format
e.g.5.280% becomes .05280
All valid data written to the output files should be comma delimited.
This includes the header rows.
For example:
3-Year 91282CJP7 No 12/15/202312/15/20264.490%4.375%
Becomes
3-Year,9128CJP7,No,20231215,20261215,.04490,.04375
image text in transcribed

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

Students also viewed these Databases questions