(Solved) : Java Create Netbeans Project Using Standard Naming Convention Objective Assignment Reading Q42767612 . . .

In Java, create a Netbeans project using the standard namingconvention.

Objective:

For this assignment you will be reading data from a variety offiles, verifying that the data is correct, and writing the data outto an output file in a new format.

Your input data will be a series of ASCII text files stored invarious subdirectories on a file system. You will need to read datain from each of these files. You will not know in advance the namesor locations of the files other than a starting directory.

The data files contain end of day financial information storedin a comma delimited fashion, i.e. CSV or comma separated values.Each file has a .txt extension.

The data files will fall into two categories:

  • Stock data – Information on a specific stock.
  • Index data – Information on a specific index.

Each file will begin with a header line indicating the datafields for each row (record).

  • Each record will include the following fields:
  • Name as a String
  • Ticker/symbol as a String
  • Date as a String in YYYYMMDD format
  • Open price as a double
  • High price as a double
  • Low price as a double
  • Closing price as a double
  • Volume as an int

Given a starting directory your program should:

  • Process each file the starting directory anysubdirectories
  • For each file your program should process each record excludingthe header record.

When processing a record your program should:

  • Verify that each field contains data of the appropriatetype
  • If the record appears to be valid you should write acorresponding record to an output file named EODdata.txt. Thecontents of each record should be written to the output file in acomma delimited fashion as follows:
    • Exchange abbreviation as a string
    • Name as a string
    • Ticker as a string
    • Date in YYYYMMDD format
    • Open as a 2 decimal place double
    • High as a 2 decimal place double
    • Low as a 2 decimal place double
    • Close as a 2 decimal place double
    • Volume as an integer
    • The date the file was last modified in YYYYMMDD format
    • The absolute path to the input file as a string
  • If the record does not appear to be valid you should write acorresponding record to an error file named EODdataERRORS.txt. Thecontents of each record should be written to the error file in thesame comma delimited fashion as used for the validrecords. You should check for errors such as:
    • Invalid field, a field that does not contain the correct datatype.
    • Incomplete record, a row that is missing one or morefields.
    • Invalid record, a row that has too many records.

The Exchange can be determined fromthe file name. The characters in the file name before theunderscore represent the exchange abbreviation. You will output theabbreviation as the exchange field. For your information theexchanges are:

  • NYSE         New York StockExchange
  • AMEX       American StockExchange
  • NASDAQ National Association of Securities Dealers
  • OTCBB      Over the Counter BulletinBoard
  • INDEX       not an exchange,represent an index file

In addition to writing each record to an output file, each errorfree records should also be display in the console using a nicelyformatted ASCII table.

  • The record that appear in the ASCI table should have fieldsformatted in the following fashion:
    • Exchange abbreviation as a string
    • Name as a string
    • Ticker as a string
    • Date in YYYYMMDD format
    • Open as a 2 decimal place double with comma thousandseparator
    • High as a 2 decimal place double with comma thousandseparator
    • Low as a 2 decimal place double with comma thousandseparator
    • Close as a 2 decimal place double with comma thousandseparator
    • Volume as an integer with comma thousand separator
    • The date the file was last modified in YYYYMMDD format
    • The absolute path to the input file as a string

The width of each of the columns in this ASCII shouldautomatically adjust so that each column will correctly hold itswidest values. In this table String values should be left justifiedin their columns and numeric date should be right justified intheir columns. Additionally, each column should have at least twoblank spaces before and at least two blank spaces after its values(cell padding).

It is suggested that you write a separate ASCII table methodthat:

  • at a minimum, accepts an array of values to be put into thetable as a parameter
  • allows for a variable amount of cell padding

The date the file was written can be found using thelastModified( ) method in the File class. This method returns thedate as a UNIX date, i.e. a long value that is the number ofmilliseconds since January 1, 1970 (The UNIX Epoch).

Section of Input Data:

<name>,<ticker>,<date>,<open>,<high>,<low>,<close>,<vol>
Perth Mint Physical GoldETF,AAAU,20191114,14.66,14.715,14.62,14.6644,12200
Advisorshares Dorsey WrightADR,AADR,20191114,49.91,50.11,49.68,50.11,4300
Altisource Asset,AAMC,20191114,11.55,12.1,11.55,12.1,500
Almaden Minerals,AAU,20191114,0.54,0.54,0.5,0.523,318700
Alps Clean EnergyETF,ACES,20191114,31.62,31.7803,31.5,31.7803,19900
Aptus Collared Income OpportunityETF,ACIO,20191114,24.2,25.2,24.2,25.1758,20700
Xtrackers MSCI ACWI Ex USA ESG Leaders EquityEt,ACSG,20191114,27.29,27.35,27.29,27.3262,3000
American Customer Satisfaction Core AlphaETF,ACSI,20191114,34.7184,34.762,34.63,34.7039,3600
Acme United Corp,ACU,20191114,20.49,20.95,20.471,20.95,2500

Expert Answer


Answer to In Java, create a Netbeans project using the standard naming convention. Objective: For this assignment you will be read…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us