Question: The book name is Java An introduction to problem sloving 7ed There are three thing in this project one is in.txt, second out.txt and third
The book name is Java An introduction to problem sloving 7ed
There are three thing in this project one is in.txt, second out.txt and third is abbreviations.txt. So make sure you give me the right code what i need for this project plz.
Plz give the code in java and it match with the prof output below. Plz provide your output too.
The Assignment:
Chapter 10:
Programming Projects 5: This project is found starting on page 811
Assignment Guidelines:
Text messaging is a popular means of communication. Many abbreviations are in common use but are not appropriate for formal communication. Suppose the abbreviations are stored, one to a line, in a text file named abbreviations.txt. For example, the file might contain these lines:
lol
:)
iirc
4
u
ttfn
Write a program that will read a message from another text file and surround each occurrence of an abbreviation with <> brackets. Write the marked message to a new text file.
For example, if the message to be scanned is
How are u today? Iirc, this is your first free day. Hope you are having fun! :)
the new text file should contain
How are today?
<:)>
Note:
The solution for this project makes use of a couple methods that break out the processing of a line. The major method processes and marks a line for a single abbreviation. It finds the index of the abbreviation in the line and then breaks the line up into 3 parts. It then gets the character immediately before and after the abbreviation and checks to see if either is a letter or digit. If so, then we assume that the abbreviation is part of a legal word and dont mark it. Otherwise, we splice in the <> marker. This is done in a while loop that processes the remaining part of the line until the abbreviation is not found.
Sample run:
----jGRASP exec: java AbreviationMarkerDemo What is the file to read from? in.txt What is the file to write to with abbreviations marked out.dat What is the abbreviations file to read from? abbreviations.txt File processing completed. ----jGRASP: operation complete.
Note:
1. Use the following abbreviations and input files. they must be saved in the same folder of the Java classes of the assignment:
abbreviations.txt
in.txt
2. Prompt the user for the name of the input file.
3. Prompt the user for name of the output file.
4. Prompt the user for name of the abreviations file.
5. Open and read input file, using methods in class AbreviationMarker.
6. Precess text read, using methods in class AbreviationMarker
7. Write the output into the output file, using a method in class AbreviationMarker
8. The assignment must have at least the following classes:
A. AbreviationMarker, in file AbreviationMarker.java
B. AbreviationMarkerDemo, in file AbreviationMarkerDemo.java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
