Question

FOR JAVA Write a program that takes two command line arguments: an input file and an...

FOR JAVA

Write a program that takes two command line arguments: an input file and an output file. The program should read the input file and replace the last letter of each word with a * character and write the result to the output file. The program should maintain the input file's line separators. The program should catch all possible checked exceptions and display an informative message.

Notes:

This program can be written in a single main method

Remember that Scanner objects can be opened on the keyboard, a file, or a String.

You may assume that the file ends with a newline sequence (i.e., the file ends with \n).

A sample text file is attached.

Sample Text:

When in the Course of human events it becomes necessary for one people to dissolve 
the political bands which have connected them with another and to assume among the 
powers of the earth the separate and equal station to which the Laws of Nature 
and of Nature's God entitle them a decent respect to the opinions of mankind 
requires that they should declare the causes which impel them to the separation
0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
FOR JAVA Write a program that takes two command line arguments: an input file and an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Write a program that takes in a line of text as input, and outputs that line...

    Write a program that takes in a line of text as input, and outputs that line of text in reverse. You may assume that each line of text will not exceed 50 characters. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text. Ex: If the input is: Hello there Hey quit then the output is: ereht olleH уен Hint: Use the fgets function to read a string with spaces from the user...

  • C++ (1) Write a program to prompt the user for an input and output file name....

    C++ (1) Write a program to prompt the user for an input and output file name. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs. For example, (user input shown in caps in first line, and in second case, trying to write to a folder which you may not have write authority in) Enter input filename: DOESNOTEXIST.T Error opening input file: DOESNOTEXIST.T...

  • Please write this in C. Write this code in Visual Studio and upload your Source.cpp file for checking (1) Write a program to prompt the user for an output file name and 2 input file names. The progra...

    Please write this in C. Write this code in Visual Studio and upload your Source.cpp file for checking (1) Write a program to prompt the user for an output file name and 2 input file names. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs opening any of the 3 For example, (user input shown in caps in first line) Enter first...

  • ( IN JAVA): Write a program that reads each line in a file, and writes them...

    ( IN JAVA): Write a program that reads each line in a file, and writes them out in reverse order into another file. This program should ask the user for the name of an input file, and the name of the output file. If the input file contains: Mary had a little lamb Its fleece was white as snow And everywhere that Mary went The lamb was sure to go Then the output file should end up containing: The lamb...

  • After reading pages 330 - 336, write a program that takes two command line arguments which...

    After reading pages 330 - 336, write a program that takes two command line arguments which are file names. The program should read the first file line by line and write each line, in reverse order, into the second file. The program should include a "usage" method that displays the correct command line syntax if two file names are not provided. Example: if my input file says Hello, World! then my output file will contain !dlroW ,olleH Hints: Use CaesarCipher...

  • Command Line Arguments: Write a program in C Compiler that will accept two integers on command...

    Command Line Arguments: Write a program in C Compiler that will accept two integers on command line, subtract the second from the first (1st - 2nd) and display the answer. It exactly two numbers are not provided on command line, there should be a simple error message printed and the program ends with no further input, output, or calculations

  • Java Exceptions Suppose a library is processing an input file containing the titles of books in...

    Java Exceptions Suppose a library is processing an input file containing the titles of books in order to remove duplicates. Write a program that reads all of the titles from an input file called bookTitles.inp and writes them to an output file called uniqueTitles.out. When complete, the output file should contain all unique titles found in the input file. Create the input file using Notepad or another text editor, with one title per line. Make sure you have a number...

  • Objective: Use input/output files, strings, and command line arguments. Write a program that processes a text...

    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...

  • Write a PYTHON program that asks the user for the name of the file. The program...

    Write a PYTHON program that asks the user for the name of the file. The program should write the contents of this input file to an output file. In the output file, each line should be preceded with a line number followed by a colon. The output file will have the same name as the input filename, preceded by “ln” (for linenumbers). Be sure to use Try/except to catch all exceptions. For example, when prompted, if the user specifies “sampleprogram.py”...

  • The program will need to accept two input arguments: the path of the input file and...

    The program will need to accept two input arguments: the path of the input file and the path of the output file. See etc/cpp/example.ifstream.cpp for the basis of how to do this. Once the input and output file paths have been received, the program will need to open the input and output files, read and process each input file line and create a corresponding output file line, close the input and output files, and then create and output some summary...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT