The document describes Java code for a lab exercise that creates a Paragraph object using a Word class. The main method gets text from the user, creates a Paragraph with the text, gets the text from the Paragraph, creates a Word object with the text, and calls the Word's modifiedText method. The modifiedText method takes a substring and word from the user, finds occurrences of the substring in the text, and appends the word to create a modified text which is returned.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views2 pages
Lab 2
The document describes Java code for a lab exercise that creates a Paragraph object using a Word class. The main method gets text from the user, creates a Paragraph with the text, gets the text from the Paragraph, creates a Word object with the text, and calls the Word's modifiedText method. The modifiedText method takes a substring and word from the user, finds occurrences of the substring in the text, and appends the word to create a modified text which is returned.
Python Advanced Programming: The Guide to Learn Python Programming. Reference with Exercises and Samples About Dynamical Programming, Multithreading, Multiprocessing, Debugging, Testing and More