Answered step by step
Verified Expert Solution
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 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 CSCOLUMNS, 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 commandline argument, then that commandline 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 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 CSPRECISION, 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 commandline 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 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 CSGROUPS, 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 commandline
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started