Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Filter. java program requires three parameters. One parameter determines how many input numbers get grouped together. Another parameter determines the number of output columns.

The Filter. java program requires three parameters. One parameter determines how many input numbers get grouped together. Another parameter determines the number of output columns. And another parameter determines the number of digits that are printed after a decimal point (this is called the precision of a decimal number).
The input numbers should be "right justified" in each output column, which means that all the decimal points in a column should line up vertically. The total width of an output column is 4+1+ precision characters. There should always be exactly two spaces between the output columns. Each group of numbers should be separated by a blank line.
In Filter.java, the default number of output columns should be three. If the properties file filter.properties exits in the current directory, and if that properties files contains a key with the name "columns", then the value of the "columns" key overrides the default number of output columns. If there is an environment variable called CS336_COLUMNS, then the value of that environment variable overrides the default number of columns and the number of columns set by the properties file (if it exits). If there is a first command-line argument, then that command-line argument overrides the environment variable (if there is one), the properties file (if it exits), and the default number of columns.
The decimal points of all the numbers in an output column must line up. You line up the decimal points by calling the printf method with an appropriate format string. The number of digits after a decimal point is called the precision of a decimal number. All the numbers in the output will have the same precision. Not all of the numbers in a column will have the same number of digits. Each number in a column should be padded with spaces on the left of the number to fill up its column.
In Filter.java, the default precision for your output numbers is 13 decimal places. If the properties file filter.properties exits in the current directory, and if that properties files contains a key with the name "precision", then the value of the "precision" key overrides the default precision. If there is an environment variable called CS336_PRECISION, then the value of that environment variable overrides the default precision and the precision set by the properties file (if it exits). If there is a second command-line parameter, then that commandline parameter overrides the environment variable (if there is one), the properties file (if it exits), and the default value of precision.
The input numbers should be combined into groups with the members of each group being formatted into the appropriate number of columns and with a blank line separating each group. In Filter.java the default length of a group should be 0, which means that all the input numbers should be placed in a single group. If the properties file filter.properties exits in the current directory, and if that properties files contains a key with the name "groups", then the value of the "groups" key overrides the default length for groups. If there is an environment variable called CS336_GROUPS, then the value of that variable overrides the default length and the length set by the property file (if it exits). If there is a third command-line
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

Recommended Textbook for

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago

Question

3. What strategies might you use?

Answered: 1 week ago