Page 1 of 1

URGENT!!! Complete this code so that it must compile. Comment each step!!! Two Methods numericPattern() The method that

Posted: Sun May 15, 2022 1:35 pm
by answerhappygod
URGENT!!!
Complete this code so that it must compile. Comment each
step!!!
Two Methods numericPattern()
The method that takes two parameters, size and direction, and
returns a string with a pattern of numbers.
Parameter of integer type called size that
defines the size of pattern.
Parameter of boolean type
called direction defines the direction of the
pattern.
Please see method calls and the patterns they produce below.
The method must
throw IllegalArgumentException when the value of
parameter size is a 0 or a negative number.
Method calls and patterns they produce:
numericPattern(5, true) returns string “123454321”
numericPattern(5, false) returns string “543212345”
numericPattern(3, true) returns string “12321”
numericPattern(1, true) returns string “1”
numericPattern(1, false) returns string “1”
Add Java Doc comments before the method
header.
See how to write them here:
https://www.oracle.com/technetwork/java ... 37868.html
(Links to an external site.)
Start coding with TwoMethods04.java
Two Methods fileAnalysis()
Write a method that takes two file name strings as
parameters, inputFileName and outputFileName ,
analyzes the sequence of integers stored in the first file and
stores results of analysis in the second file. The following
statistics of the data in inputFileName must be
calculated and written into
the outputFileName file:
Assume that all the numbers stored in the input file are
integers and stored one number per line.
The method does not return any values.
The method throws IOException when the files
fail to open for reading and writing. Instead of catching the
exception in the method let it bubble up into the calling code.
Requirements:
Following are some examples
Example # 1: File "testCaseIN.txt" has the following
numbers in it:
The output file will have the following statistics written
into it
Example # 2: File "testCaseIn1.txt" has only one
number: 1
The output file will have the following statistics written
into it
Example # 3: File "testCaseIn2.txt" is empty
The output file will have the following statistics written
into it
This output format must be followed precisely in order
to pass the tests provided for debugging.
Start coding with TwoMethods04.java