COP-3337 Programming II
Programming Assignment 5
FIU Knight Foundation School of Computing & Info. Sciences
In this assignment, you are asked to complete a Java program that converts a file format
to another. It should support the following formats:
.csv (comma separated values) file: stores tabular data in plain text. Each line of the
file represents a table row containing one or more cells separated by commas. If a
content of a cell has one or more commas (e.g. 12,345), then that cell’s content needs
to be enclosed in double-quotations (e.g. “12,345”).
.txt (tab separated values) file: stores tabular data in plain text. Each line of the file
epresents a table row containing one or more cells separated by tab characters (\t).
The content of each cell does not have any tab character.
1 Program Commands
(35 points) convert source.xxx destination.yyy: this command converts source.xxx
to destination.yyy where source.xxx is the name and extension of the file that use
wants to convert and destination.yyy is the name and extension of the file in which
the user wants to store the result of format conversion. Please note that xxx and yyy
can either be csv or txt. Also, the file names may or may not include the path to the
file in the file system.
(60 points) normalize source.xxx: this command reads the content of source.xxx,
normalizes the content of each cell, and writes the normalized content back to the same
file. Normalizing a cell is an operation that depends on the cu
ent content of the cell:
– if cell is empty: writes N/A instead
– if cell contains an integer: normalization explicitly shows the sign (+ for pos-
itive and - for negative). Also, if the integer representation is shorter than 10
characters, it adds some leading zeros to make the representation 10 characte
– if cell contains a float/double: normalization shows two digit after decimal point.
Also, it uses scientific notation if the number is greater than 100 or less than 0.01.
– if cell contains a string longer than 13 characters, normalization shows the first
10 characters of the string followed by an ellipsis (three dots like this . . . )
– otherwise, normalization causes no change.
(5 points) quit: ends the program.
You need to submit a .zip file compressing the following folders:
the packages containing all the java source files related to the assignment (.java files).
A readme file clearly explaining what parts have/haven’t been implemented.