![// Copy text file and insert line numbers Create a NetBeans project named AddLineNumbers following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. After you have created your NetBeans project AddLineNumbers and before you attempt to execute your application download and/or copy the text data file datalnput.txt from the course Blackboard to the AddLineNumbers project folder After you have created your NetBeans Project your application class should contain the following executable code: package addlinenumbers; public class AddLineNumbers f public static void main(Stringl args) Write the code for the main class as indicated below: package addlinenumber /* mport the Scanner class and all classes from java.io */ // Your code here public class AddLineNumbers public static void main( String [] args) /* Declare variable identifiers to handle text data input from the file and count/increment the linenumber*/ // Your code here * Start try block / // Your code here /* Instantiate Scanner object for data input from file datalnput.txt. There should be no path specification as your input file should be located in your AddLineNumbers project folder*/ // Your code here](http://img.homeworklib.com/questions/b5c80340-d0f6-11ea-a2cd-97a36b585155.png?x-oss-process=image/resize,w_560)


I have the files set up in the write place. I am just confused on how to use some of the desire methods to execute this code.
package AddLineNumbers;
import java.io.*;
import java.util.*;
public class AddLineNumber{
public static void main(String[] args){
try
{
FileInputStream fstream = new FileInputStream("dataInput.txt");
//Assuming the input filename as textfile.txt
BufferedReader br = new BufferedReader(new
InputStreamReader(fstream));
String strLine;
File fout = new File("dataOutput.txt");
FileOutputStream fos = new FileOutputStream(fout);
PrintWriter writer = new PrintWriter(fos);
int count = 0;
while ((strLine = br.readLine()) != null) {
count++;
writer.println( Integer.toString(count) + "." + strLine );
}
System.out.println("Output file has been written");
br.close();
writer.close();
}
catch
(FileNotFoundException e)
{
e.getMessage();
e.toString();
e.printStackTrace();
}
catch
(IOException e)
{
e.getMessage();
e.toString();
e.printStackTrace();
}
}
}
I have the files set up in the write place. I am just confused on how...
// Client application class and service class Create a NetBeans project named StudentClient following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. Add a class named Student to the StudentClient project following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. After you have created your NetBeans Project your application class StudentC lient should contain the following executable code: package studentclient; public class...
Below I have my 3 files. I am trying to make a dog array that aggerates with the human array. I want the users to be able to name the dogs and display the dog array but it isn't working. //Main File import java.util.*; import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.print("There are 5 humans.\n"); array(); } public static String[] array() { //Let the user...
Hey I really need some help asap!!!! I have to take the node class that is in my ziplist file class and give it it's own file. My project has to have 4 file classes but have 3. The Node class is currently in the ziplist file. I need it to be in it's own file, but I am stuck on how to do this. I also need a uml diagram lab report explaining how I tested my code input...
***Please keep given code intact*** Write a JavaFX application that displays a label and a Button to a frame in the FXBookQuote2 program. When the user clicks the button, display the title of the book that contains the opening sentence or two from your favorite book in the label. FXBookQuote2.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the...
Java has a class for a stack. It is java.util.Stack. Let us make use of this class. Step 1: Create a project. Name the project MyStk. This will result in the creation of the main class called MyStk if you are using Netbeans IDE with relevant default settings unchanged. If comments are excluded you should see the following in the code editor after creating the project. package mystk; public class MyStk { public static void main(String[ ] args){ } }...
I am given an input file, P1input.txt and I have to write code to find the min and max, as well as prime and perfect numbers from the input file. P1input.txt contains a hundred integers. Why doesn't my code compile properly to show me all the numbers? It just stops and displays usage: C:\> java Project1 P1input.txt 1 30 import java.io.*; // BufferedReader import java.util.*; // Scanner to read from a text file public class Project1 { public static...
Q1: Write a class that throws an ExtraneousStringException when a string has more than 30 characters in it (see ExtraneousStringException.java. This java file does not need to be modified). Copy paste the contents of ExtraneousStringException.java into a new .java file, uncomment the commented out code, and write your code inside the main method. In the driver class, keep reading strings from the user until the user enters “DONE.” You may read your input from a file, or use the console....
Can someone please help me? I'm having trouble with this assignment and have been stuck trying to figure it out for over an hour. Here's the assignment details below: 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...
I am working on this switch statement code and I am getting errors. Please help. import java.util.Scanner; public class Switchstatement { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } class Convertor { public static void main(String[] args) { int choice; Double Yen, UsDollars, Kilometer, Miles, Kilograms, Pounds, Inches; Double Centimeters, result; Scanner scanner = new Scanner(System.in); System.out.print("Enter 1\t UsDollars to Yen:...
Java Your boss has just put you in charge of updating the company's client contact list. This file contains records in the following format: id,first_name,last_name,email 1,Norry,Killby,nkillby0@photobucket.com Your job is to reformat each record as follows: last_name, first_name, email Killby, Norry, <nkillby0@photobucket.com> Starter Code: package contactlistupdater; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Paths; import java.util.Formatter; import java.util.Scanner; import sun.reflect.generics.reflectiveObjects.NotImplementedException; public class ContactListUpdater { private static final String INPUT_FILENAME = "contacts.txt"; private static final String OUTPUT_FILENAME = "updated-contacts.txt"; /** * Transforms a String...