Java code, using recursion please. **NEW CODE ONLY** Write a method, printLinesInArray, that takes three parameters: a B

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Java code, using recursion please. **NEW CODE ONLY** Write a method, printLinesInArray, that takes three parameters: a B

Post by answerhappygod »

Java code, using recursion please. **NEW CODE ONLY**
Write a method, printLinesInArray, that takes three parameters:
a BufferedReader , a PrintWriter and a sorted array of distinct
integers. The method will write to the output (with the
PrintWriter) the lines of the input (read with the BufferedReader)
whose numbers are listed in the array. For instance if the array
contains the values {-10, 18, 24, 55, 133}, and the file read by
the BufferedReader has 100 lines line 1 line 2 … line 100 then the
PrintWriter should write to the output the lines 18, 24 and 55
since they all appear in the array. The values -10 and 133 are
ignored since they do not match any line number in the file. Your
solution should use recursion ONLY. No loops are allowed. Write
your solution in this file: .
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply