PLEASE GIVE IT A THUMBS UP

import java.util.*;
import java.lang.*;
import java.io.*;
class MergeFiles{
public static void removeDuplicates(Vector v)
{
for(int i=0;i<v.size();i++)
for(int j=0;j<v.size();j++)
if(i!=j)
if(v.elementAt(i).equals(v.elementAt(j)))
v.removeElementAt(j);
}
public static void main(String[] args) throws
Exception {
Vector<String> name = new
Vector<String>();
File f = new
File(args[0]+".txt");
BufferedReader br = new
BufferedReader(new FileReader(f));
while(true){
String s =
br.readLine();
if(s==null)
break;
name.add(s);
}
br.close();
f = new File(args[1]+".txt");
br = new BufferedReader(new
FileReader(f));
while(true){
String s =
br.readLine();
if(s==null)
break;
name.add(s);
}
br.close();
Collections.sort(name);
removeDuplicates(name);
f = new File(args[2]+".txt");
BufferedWriter bw = new
BufferedWriter(new FileWriter(f));
for(int
i=0;i<name.size();i++)
bw.write(name.elementAt(i)+"\n");
bw.close();
}
}



nikhil
saksham
hrithik
ayush
meghu

srishti
himanshi
sid
nikhil
saksham
Homework 1- Merge Files: 1. Design a class named MergeFiles 1 Three file names are passed...
Description: Merge two or more text files provided by the user into a new text file where the names of the text files to join and the output text file are provided to the program using command line arguments. Purpose: This application provides experience working with command line arguments, writing files to disk, reading files from disk, working with exceptions, and writing programs in C#/.NET. Requirements: Project Name: DocumentMerger2 Target Platform: Console Programming Language: C# In a previous challenge, Document...
This assignment uses functions, files, and strings. Enough flexibility is provided for you to apply your knowledge of basic C++ programing to develop your solution. Develop a functional flowchart and then write a C++ program to solve the following problem. 1. Create a text file named file1.txt and write your brand of car (like Honda, Toyota, etc) in the file. You will be reading the name of the file from the keyboard as a string, using the string class. Your...
Q22 Consider the following 2 text files and Java program. 8 Points Answer the following questions keeping in mind that: • All three files are in the same directory, and there are no other files. • The program may crash. If the program crashes, answer the question with: "The program crashes" standings1.txt: 1 Valtteri Bottas 25 2 Charles Leclerc 18 3 Lando Norris 16 4 Lewis Hamilton 12 standings2.txt: 1 Valtteri Bottas 43 2 Lewis Hamilton 37 3 Lando Norris...
Objective: Use input/output files, strings, and command line arguments. Write a program that processes a text file by removing all blank lines (including lines that only contain white spaces), all spaces/tabs before the beginning of the line, and all spaces/tabs at the end of the line. The file must be saved under a different name with all the lines numbered and a single blank line added at the end of the file. For example, if the input file is given...
**Java** Assume that indata1 and indata2 are two files containing at least two integers, separated by white space. Write a program named Add2 that writes the sum of the first integers of these two files to a file named outdata1. It writes the sum of the first integers of these two files to a file named outdata2. Each sum is written on a line by itself. So, if the contents of indata1 were "37 6 90" and the contents of...
Write you code in a class named HighScores, in file named HighScores.java. Write a program that records high-score data for a fictitious game. The program will ask the user to enter five names, and five scores. It will store the data in memory, and print it back out sorted by score. The output from your program should look approximately like this: Enter the name for score #1: Suzy Enter the score for score #1: 600 Enter the name for score...
Java console-based question. Do not use BufferedReader please. A file named customers.txt contains the names of customers for a local hairdressing salon. Unfortunately, the data in the file is in no particular order yet the owner of the salon would like the data in alphabetical order. Write a Java program that reads the contents of the file into an array of Strings, sorts the array of Strings into alphabetical order, and then writes the content of the array to a...
i have to write a program that asks the names of 2 files. the first should be open for reading second for writing. the program should read the the contents of the first file change all characters to uppercase and store in the second file. the second file will be a copy of the first file, except that all characters will be uppercase. use notepad to test the program. i got this so far { String firstfile; String...
4.3Learning Objective: To read and write text files. Instructions: This is complete program with one Java source code file named H01_43.java (your main class is named H01_43). Problem: Write a program that prompts the user for the name of a Java source code file (you may assume the file contains Java source code and has a .java filename extension; we will not test your program on non-Java source code files). The program shall read the source code file and output...
Write a program that reads a file named input.txt and writes a file that contains the same contents, but is named output.txt. The input file will contain more than one line when I test this. Do not use a path name when opening these files. This means the files should be located in the top level folder of the project. Do not use a copy method that is supplied by Java. Your program must read the file line by line...