1 / 2

PRG 421 Week 3 Individual Assignment Coding a Program Containing Manipulating Data with the Java™ Stream AP//tutorfortun

PRG 421 Week 3 Individual Assignment Coding a Program Containing Manipulating Data with the Javau2122 Stream AP//tutorfortune.com<br><br>Click on below link to buy<br>https://tutorfortune.com/products/prg-421-week-3-individual-assignment-coding-a-program-containing-manipulating-data-with-the-java-stream-ap<br><br>For this assignment, you will develop "starter" code. After you finish, your code should access an existing text file that you have created, create an input stream, read the contents of the text flie, sort and store the contents of the text file into an ArrayList, then write the sorted contents via an ouput stream to a separate output text file.<br>Copy and paste the following Javau2122 code into a JAVA source file in NetBeans:<br> <br>import java.io.BufferedReader;<br>import java.io.BufferedWriter;<br> <br>public class Datasort {<br> <br>public static void main (String [] args) {<br> <br>File fin = // input file<br>File fout = // create an out file<br> <br>// Java FileInputStream class obtains input bytes from a file<br>FileInputStream fis = new FileInputStream(fin); <br> <br>// buffering characters so as to provide for the efficient reading of characters, arrays, and lines<br>BufferedReader in = new BufferedReader(new InputStreamReader(fis));<br> <br>// declare an array in-line, ready for the sort<br>String aLine;<br>ArrayList<String> al = new ArrayList<String> ();<br> <br>int i = 0;<br>while ((aLine = in.readLine()) != null) {<br>// set the sort for values is greater than 0<br> <br>Collections.sort(al); // sorted content to the output file<br>{<br>System.out.println(s);<br> <br>}<br> // close the 2 files<br> <br>}<br>}<br> <br>Add code as indicated in the comments.<br>Note: Refer to this week's Individual assignment, "Week Three Analyze Assignment," and to Ch. 8, "IO," in OCP: Oracleu00ae Certified Professional Javau00ae SE 8 Programmer II Study Guide.<br>Run and debug your modified program in NetBeans until it satisfies the requirements described above.<br>Save your finalized JAVA file with a .txt extension.<br>Submit your TXT file to the Assignment Files tab.<br><br>Click on below link to buy<br>https://tutorfortune.com/products/prg-421-week-3-individual-assignment-coding-a-program-containing-manipulating-data-with-the-java-stream-ap<br>

xafi
Download Presentation

PRG 421 Week 3 Individual Assignment Coding a Program Containing Manipulating Data with the Java™ Stream AP//tutorfortun

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


More Related