A Simple Java Program
$30 USD
Paiement à la livraison
Write a program that prompts the user to enter the name of
an input text file.
If the file cannot be open, the program prints an error message and
exits.
Otherwise, the program prompts the user for the name of
the output file. If the output file cannot be opened, the program
prints an error message and exits.
Otherwise the program processes every line of the input file as
follows. If the input line has two strings like
Pepe Garcia
the program writes the line
P. Garcia
on the output page.
If the input line does not have 2 words ( it may be 0, 1, 3, or more)
the program prints the contents of the line on the [url removed, login to view] file
and states that this file does not have the format word1 word2.
This file reads a file of names of the form
FirstName LastNames
It copies the initial of the first name and
the last name on the output file as shown below.
FirstNameInitial. LastName
If the input line does not have 2 words, it is displayed on the monitor
as an error.
Use the provided files to test the program.
Nº du projet : #1273220