SlideShare a Scribd company logo
1 of 7
Assignment 2
Assignment Content
1.
Top of Form
Resource:
· "Console/File Input and Output" text file
For this assignment, you will build on "starter" code to create a
Java™ program that prompts the user for input, accepts user
input, and produces both console and file output.
Copy the linked code to a JAVA file.
Add Java® code based on the comments inside the code.
Note: Refer to this week's Individual "Week Two Analyze
Assignment" for model code you can adapt to meet this
assignment's requirements.
Test, debug, and run your code using the NetBeans editor to
make sure it meets the program requirements.
Save your JAVA file with a .txt extension.
* Program: Week 2 Code Assignment
* Purpose: Console/file input and output
* Programmer: YOUR NAME HERE
* Class: PRG/421r13, Java Programming II
* Instructor: YOUR INSTRUCTOR HERE
* Creation Date: TODAY'S DATE
* Comments: Fill in code
*
*****************************************************
******************/
package demo;
import java.util.Scanner; // scanner is a predefined class
for taking inputs from user
public class Startercode
{
public static void main(String[] args)
{
// prompts and accepts user input
Scanner input= new Scanner(System.in);
double data;
System.out.println("Enter value ");
// accepts file input
String fileName = "input.txt"; // name of the
file to open
String line = null; // will reference one
line at a time
try {
FileReader fileReader = // FileReader
reads text file
new FileReader(fileName); // reads in
data from the file
// produces both console and file output
try { // coding block to output
data to file
fileStdout = new PrintStream(new
FileOutputStream("data.txt")); // output file name is data.txt
System.out.println("=============="); // output
to console, numbers 0 through 9
fileStdout.println("" + i);
// ENTER YOUR CODE HERE. Enter code to end program
successfully. Bottom of Form
Assignment 3
Assignment Content
1.
Top of Form
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.
Copy and paste the following Java™ code into a JAVA source
file in NetBeans:
import java.io.BufferedReader;
import java.io.BufferedWriter;
public class Datasort {
public static void main (String [] args) {
File fin = // input file
File fout = // create an out file
// Java FileInputStream class obtains input bytes from a file
FileInputStream fis = new FileInputStream(fin);
// buffering characters so as to provide for the efficient reading
of characters, arrays, and lines
BufferedReader in = new BufferedReader(new
InputStreamReader(fis));
// declare an array in-line, ready for the sort
String aLine;
ArrayList<String> al = new ArrayList<String> ();
int i = 0;
while ((aLine = in.readLine()) != null) {
// set the sort for values is greater than 0
Collections.sort(al); // sorted content to the output file
{
System.out.println(s);
}
// close the 2 files
}
}
Add code as indicated in the comments.
Note: Refer to this week's Individual assignment, "Week Three
Analyze Assignment," and to Ch. 8, "IO," in OCP:
Oracle® Certified Professional Java® SE 8 Programmer II
Study Guide.
Run and debug your modified program in NetBeans until it
satisfies the requirements described above.
Save your finalized JAVA file with a .txt extension
Week 3 analysis assignment referred to
/****************************************************
******************
* Program: Datasort
* Purpose: Java code that sorts, extracts data and saves it to
a collection
* Programmer: I am student
* Class: PRG/421r13, Java Programming II
* Instructor:
* Creation Date: 12/01/2017
*
* Comments:
* Extracts data from a file, sorts it, displays it onscreen, and
saves it.
*
*****************************************************
******************/
// import the needed classes
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
public class Datasort {
public static void main (String [] args) throws IOException {
File fin = new File("e:input.txt"); // input file on e: drive
(with data)
File fout = new File("e:sorted.txt"); // create an out file on
e: drive
// Java FileInputStream class obtains input bytes from a file
FileInputStream fis = new FileInputStream(fin);
FileOutputStream fos = new FileOutputStream(fout);
// buffering characters so as to provide for the efficient reading
of characters, arrays, and lines
BufferedReader in = new BufferedReader(new
InputStreamReader(fis));
BufferedWriter out = new BufferedWriter(new
OutputStreamWriter(fos));
// declare an array in-line, ready for the sort
String aLine;
FLORIDA NATIONAL UNIVERSITY
RN-BSN PROGRAM
NURSING DEPARTMENT
NUR4636 – COMMUNITY HEALTH NURSING
COMMUNITY HEALTH ASSESSMENT/WINSHIELD
SURVEY
PROF. EDDIE CRUZ, RN MSN
GUIDELINES:
1. Community description.
2. Community health status (can be obtain from the department
of health).
3. The role of the community as a client.
4. Healthy people 2020, lading health indictors in your
community.
5. Conclusion.
Also, you must present a table as an appendix with the
following topics and description;
Housing
Transportation
Race and ethnicity
Open space
Service centers
Religion and politics
You are going to follow the posting instructions in the syllabus.
The assignment will be posted in both the discussion tab of the
blackboard by September 15, 2019 @ 11:59 and then I will open
for you to review your peers and post two replies about their
assessment.
This assignment has a total of 100 points. I will be monitoring
plagiarism very closely.
If you have any question you can contact me via FNU email.

More Related Content

Similar to Assignment 2Assignment Content1. Top of FormResource·.docx

FileWrite.javaFileWrite.java  To change this license header.docx
FileWrite.javaFileWrite.java  To change this license header.docxFileWrite.javaFileWrite.java  To change this license header.docx
FileWrite.javaFileWrite.java  To change this license header.docx
ssuser454af01
 
Week 4 Individual Assignmentbuild.xml Builds, tests, a.docx
Week 4 Individual Assignmentbuild.xml      Builds, tests, a.docxWeek 4 Individual Assignmentbuild.xml      Builds, tests, a.docx
Week 4 Individual Assignmentbuild.xml Builds, tests, a.docx
melbruce90096
 
file-transfer-using-tcp.pdf
file-transfer-using-tcp.pdffile-transfer-using-tcp.pdf
file-transfer-using-tcp.pdf
Jayaprasanna4
 
Character stream classes introd .51
Character stream classes introd  .51Character stream classes introd  .51
Character stream classes introd .51
myrajendra
 
Question IYou are going to use the semaphores for process sy.docx
Question IYou are going to use the semaphores for process sy.docxQuestion IYou are going to use the semaphores for process sy.docx
Question IYou are going to use the semaphores for process sy.docx
audeleypearl
 

Similar to Assignment 2Assignment Content1. Top of FormResource·.docx (20)

1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
Input output files in java
Input output files in javaInput output files in java
Input output files in java
 
FileWrite.javaFileWrite.java  To change this license header.docx
FileWrite.javaFileWrite.java  To change this license header.docxFileWrite.javaFileWrite.java  To change this license header.docx
FileWrite.javaFileWrite.java  To change this license header.docx
 
Writing documentation with Asciidoctor
Writing documentation  with  AsciidoctorWriting documentation  with  Asciidoctor
Writing documentation with Asciidoctor
 
Unit No 5 Files and Database Connectivity.pptx
Unit No 5 Files and Database Connectivity.pptxUnit No 5 Files and Database Connectivity.pptx
Unit No 5 Files and Database Connectivity.pptx
 
Core java introduction
Core java introduction Core java introduction
Core java introduction
 
Week 4 Individual Assignmentbuild.xml Builds, tests, a.docx
Week 4 Individual Assignmentbuild.xml      Builds, tests, a.docxWeek 4 Individual Assignmentbuild.xml      Builds, tests, a.docx
Week 4 Individual Assignmentbuild.xml Builds, tests, a.docx
 
file-transfer-using-tcp.pdf
file-transfer-using-tcp.pdffile-transfer-using-tcp.pdf
file-transfer-using-tcp.pdf
 
Character stream classes introd .51
Character stream classes introd  .51Character stream classes introd  .51
Character stream classes introd .51
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
 
Question IYou are going to use the semaphores for process sy.docx
Question IYou are going to use the semaphores for process sy.docxQuestion IYou are going to use the semaphores for process sy.docx
Question IYou are going to use the semaphores for process sy.docx
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Introduction to Node JS1.pdf
Introduction to Node JS1.pdfIntroduction to Node JS1.pdf
Introduction to Node JS1.pdf
 
Apache ant
Apache antApache ant
Apache ant
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdf
 
Java Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug ClassJava Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug Class
 
B.Sc. III(VI Sem) Advance Java Unit2: Appet
B.Sc. III(VI Sem) Advance Java Unit2: AppetB.Sc. III(VI Sem) Advance Java Unit2: Appet
B.Sc. III(VI Sem) Advance Java Unit2: Appet
 
1.26 File Input-Output in JAVA.pptx
1.26 File Input-Output in JAVA.pptx1.26 File Input-Output in JAVA.pptx
1.26 File Input-Output in JAVA.pptx
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
 

More from braycarissa250

1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx
1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx
1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx
braycarissa250
 
1.A 52-year-old obese Caucasian male presents to the clinic wit.docx
1.A 52-year-old obese Caucasian male presents to the clinic wit.docx1.A 52-year-old obese Caucasian male presents to the clinic wit.docx
1.A 52-year-old obese Caucasian male presents to the clinic wit.docx
braycarissa250
 
1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx
1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx
1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx
braycarissa250
 
1.4 Participate in health care policy development to influence nursi.docx
1.4 Participate in health care policy development to influence nursi.docx1.4 Participate in health care policy development to influence nursi.docx
1.4 Participate in health care policy development to influence nursi.docx
braycarissa250
 
1.0. Introduction Effective project management is consid.docx
1.0. Introduction Effective project management is consid.docx1.0. Introduction Effective project management is consid.docx
1.0. Introduction Effective project management is consid.docx
braycarissa250
 

More from braycarissa250 (20)

1.Does BPH predispose this patient to cancer2. Why are pati.docx
1.Does BPH predispose this patient to cancer2. Why are pati.docx1.Does BPH predispose this patient to cancer2. Why are pati.docx
1.Does BPH predispose this patient to cancer2. Why are pati.docx
 
1.Do you think that mass media mostly reflects musical taste, or.docx
1.Do you think that mass media mostly reflects musical taste, or.docx1.Do you think that mass media mostly reflects musical taste, or.docx
1.Do you think that mass media mostly reflects musical taste, or.docx
 
1.Discuss theoretical and conceptual frameworks. How are the.docx
1.Discuss theoretical and conceptual frameworks. How are the.docx1.Discuss theoretical and conceptual frameworks. How are the.docx
1.Discuss theoretical and conceptual frameworks. How are the.docx
 
1.Discuss the medical model of corrections. Is this model of c.docx
1.Discuss the medical model of corrections. Is this model of c.docx1.Discuss the medical model of corrections. Is this model of c.docx
1.Discuss the medical model of corrections. Is this model of c.docx
 
1.Discussion Question How do we perceive sacred spaceplace in Ame.docx
1.Discussion Question How do we perceive sacred spaceplace in Ame.docx1.Discussion Question How do we perceive sacred spaceplace in Ame.docx
1.Discussion Question How do we perceive sacred spaceplace in Ame.docx
 
1.Cybercriminals use many different types of malware to attack s.docx
1.Cybercriminals use many different types of malware to attack s.docx1.Cybercriminals use many different types of malware to attack s.docx
1.Cybercriminals use many different types of malware to attack s.docx
 
1.Define emotional intelligence. What are the benefits of emotional .docx
1.Define emotional intelligence. What are the benefits of emotional .docx1.Define emotional intelligence. What are the benefits of emotional .docx
1.Define emotional intelligence. What are the benefits of emotional .docx
 
1.Define Strategic Planning and Swot Analysis2.List and define.docx
1.Define Strategic Planning and Swot Analysis2.List and define.docx1.Define Strategic Planning and Swot Analysis2.List and define.docx
1.Define Strategic Planning and Swot Analysis2.List and define.docx
 
1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx
1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx
1.Choose a writer; indicate hisher contribution to the Harlem Renai.docx
 
1.Being sure that one has the resources necessary to accomplish the .docx
1.Being sure that one has the resources necessary to accomplish the .docx1.Being sure that one has the resources necessary to accomplish the .docx
1.Being sure that one has the resources necessary to accomplish the .docx
 
1.Based on how you will evaluate your EBP project, which indepen.docx
1.Based on how you will evaluate your EBP project, which indepen.docx1.Based on how you will evaluate your EBP project, which indepen.docx
1.Based on how you will evaluate your EBP project, which indepen.docx
 
1.Be organized. 2.   Spend less time doing a summary, but more o.docx
1.Be organized. 2.   Spend less time doing a summary, but more o.docx1.Be organized. 2.   Spend less time doing a summary, but more o.docx
1.Be organized. 2.   Spend less time doing a summary, but more o.docx
 
1.After discussion with your preceptor, name one financial aspec.docx
1.After discussion with your preceptor, name one financial aspec.docx1.After discussion with your preceptor, name one financial aspec.docx
1.After discussion with your preceptor, name one financial aspec.docx
 
1.A 52-year-old obese Caucasian male presents to the clinic wit.docx
1.A 52-year-old obese Caucasian male presents to the clinic wit.docx1.A 52-year-old obese Caucasian male presents to the clinic wit.docx
1.A 52-year-old obese Caucasian male presents to the clinic wit.docx
 
1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx
1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx
1.1Arguments, Premises, and ConclusionsHow Logical Are You·.docx
 
1.4 Participate in health care policy development to influence nursi.docx
1.4 Participate in health care policy development to influence nursi.docx1.4 Participate in health care policy development to influence nursi.docx
1.4 Participate in health care policy development to influence nursi.docx
 
1.5 - 2 pages single-spaced. Use 1-inch margins, 12 font, Microsoft .docx
1.5 - 2 pages single-spaced. Use 1-inch margins, 12 font, Microsoft .docx1.5 - 2 pages single-spaced. Use 1-inch margins, 12 font, Microsoft .docx
1.5 - 2 pages single-spaced. Use 1-inch margins, 12 font, Microsoft .docx
 
1.5 Pages on the following topics Diversity, Race and Gender Equity.docx
1.5 Pages on the following topics Diversity, Race and Gender Equity.docx1.5 Pages on the following topics Diversity, Race and Gender Equity.docx
1.5 Pages on the following topics Diversity, Race and Gender Equity.docx
 
1.0. Introduction Effective project management is consid.docx
1.0. Introduction Effective project management is consid.docx1.0. Introduction Effective project management is consid.docx
1.0. Introduction Effective project management is consid.docx
 
1.1 What is the OSI security architecture1.2 What is the differ.docx
1.1 What is the OSI security architecture1.2 What is the differ.docx1.1 What is the OSI security architecture1.2 What is the differ.docx
1.1 What is the OSI security architecture1.2 What is the differ.docx
 

Recently uploaded

QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

Assignment 2Assignment Content1. Top of FormResource·.docx

  • 1. Assignment 2 Assignment Content 1. Top of Form Resource: · "Console/File Input and Output" text file For this assignment, you will build on "starter" code to create a Java™ program that prompts the user for input, accepts user input, and produces both console and file output. Copy the linked code to a JAVA file. Add Java® code based on the comments inside the code. Note: Refer to this week's Individual "Week Two Analyze Assignment" for model code you can adapt to meet this assignment's requirements. Test, debug, and run your code using the NetBeans editor to make sure it meets the program requirements. Save your JAVA file with a .txt extension. * Program: Week 2 Code Assignment * Purpose: Console/file input and output * Programmer: YOUR NAME HERE * Class: PRG/421r13, Java Programming II * Instructor: YOUR INSTRUCTOR HERE * Creation Date: TODAY'S DATE * Comments: Fill in code *
  • 2. ***************************************************** ******************/ package demo; import java.util.Scanner; // scanner is a predefined class for taking inputs from user public class Startercode { public static void main(String[] args) { // prompts and accepts user input Scanner input= new Scanner(System.in); double data; System.out.println("Enter value "); // accepts file input String fileName = "input.txt"; // name of the file to open String line = null; // will reference one line at a time try { FileReader fileReader = // FileReader reads text file new FileReader(fileName); // reads in data from the file // produces both console and file output try { // coding block to output data to file fileStdout = new PrintStream(new FileOutputStream("data.txt")); // output file name is data.txt System.out.println("=============="); // output to console, numbers 0 through 9
  • 3. fileStdout.println("" + i); // ENTER YOUR CODE HERE. Enter code to end program successfully. Bottom of Form Assignment 3 Assignment Content 1. Top of Form 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. Copy and paste the following Java™ code into a JAVA source file in NetBeans: import java.io.BufferedReader; import java.io.BufferedWriter; public class Datasort { public static void main (String [] args) { File fin = // input file File fout = // create an out file // Java FileInputStream class obtains input bytes from a file FileInputStream fis = new FileInputStream(fin); // buffering characters so as to provide for the efficient reading of characters, arrays, and lines BufferedReader in = new BufferedReader(new InputStreamReader(fis)); // declare an array in-line, ready for the sort String aLine; ArrayList<String> al = new ArrayList<String> ();
  • 4. int i = 0; while ((aLine = in.readLine()) != null) { // set the sort for values is greater than 0 Collections.sort(al); // sorted content to the output file { System.out.println(s); } // close the 2 files } } Add code as indicated in the comments. Note: Refer to this week's Individual assignment, "Week Three Analyze Assignment," and to Ch. 8, "IO," in OCP: Oracle® Certified Professional Java® SE 8 Programmer II Study Guide. Run and debug your modified program in NetBeans until it satisfies the requirements described above. Save your finalized JAVA file with a .txt extension Week 3 analysis assignment referred to /**************************************************** ****************** * Program: Datasort * Purpose: Java code that sorts, extracts data and saves it to a collection * Programmer: I am student * Class: PRG/421r13, Java Programming II * Instructor: * Creation Date: 12/01/2017 * * Comments:
  • 5. * Extracts data from a file, sorts it, displays it onscreen, and saves it. * ***************************************************** ******************/ // import the needed classes import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class Datasort { public static void main (String [] args) throws IOException { File fin = new File("e:input.txt"); // input file on e: drive (with data) File fout = new File("e:sorted.txt"); // create an out file on e: drive // Java FileInputStream class obtains input bytes from a file FileInputStream fis = new FileInputStream(fin); FileOutputStream fos = new FileOutputStream(fout); // buffering characters so as to provide for the efficient reading of characters, arrays, and lines
  • 6. BufferedReader in = new BufferedReader(new InputStreamReader(fis)); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos)); // declare an array in-line, ready for the sort String aLine; FLORIDA NATIONAL UNIVERSITY RN-BSN PROGRAM NURSING DEPARTMENT NUR4636 – COMMUNITY HEALTH NURSING COMMUNITY HEALTH ASSESSMENT/WINSHIELD SURVEY PROF. EDDIE CRUZ, RN MSN GUIDELINES: 1. Community description. 2. Community health status (can be obtain from the department of health). 3. The role of the community as a client. 4. Healthy people 2020, lading health indictors in your community. 5. Conclusion. Also, you must present a table as an appendix with the following topics and description; Housing Transportation Race and ethnicity Open space Service centers Religion and politics
  • 7. You are going to follow the posting instructions in the syllabus. The assignment will be posted in both the discussion tab of the blackboard by September 15, 2019 @ 11:59 and then I will open for you to review your peers and post two replies about their assessment. This assignment has a total of 100 points. I will be monitoring plagiarism very closely. If you have any question you can contact me via FNU email.