Question: in java this is Rhyme.txt Question 2: File read write [ 30 marks] You have been tasked with creating a class called Practical12, which can
![30 marks] You have been tasked with creating a class called Practical12,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4df5d36d6b_99666f4df5cc8e1b.jpg)
Question 2: File read write [ 30 marks] You have been tasked with creating a class called Practical12, which can read in a text file named rhyme.txt containing a welcoming rhyme to secondyear computer science students. Once the file is read, the class should then write a new file called rhyme2.txt in the following format: [Verse number][Line number] line from file. To accomplish this, you will need to use file input and output operations within the class. Instructions: 1. Create a class Practical12 to read in rhyme.txt 2. Loop or do something to keep track of each line and verse 3. Create a new text file Rhyme2.txt 4. Write each new line in the format displayed below to the file Rhyme2.txt: [Verse number] [Line number] line from file 5. Write your full name and student number at the end or beginning of the text file. Sample Input: The moon shines bright in the midnight sky, As I lay here and wonder why, The stars twinkle, one by one, A peaceful sight, when day is done. The night is calm, and all is still, A moment to rest, and just be still, With the gentle breeze, and the rustling trees, I drift away, to a place of peace. Sample Output: [1] [1] The moon shines bright in the midnight sky, [1] [2] As 1 lay here and wonder why, [1] [3] The stars twinkle, one by one, [1] [4] A peaceful sight, when day is done. [2][1] The night is calm, and all is still, [2] [2] A moment to rest, and just be still, [2] [3] With the gentle breeze, and the rustling trees, [2] [4] I drift away, to a place of peace. To UWC computer science year two, Congratulations, hats off to you! You made it this far, and that's a fact, You're on your way to a promising track. You've learned so much, but there's still more, New challenges, concepts to explore, From algorithms to software design, There's so much waiting for you to find. You'll code, debug, and analyze, Building programs that will surprise, You'll face bugs and errors, but never fear, The thrill of success is always near. So keep up the hard work, and never quit, Coding can be tough, but don't forget, With each problem you solve, you'll gain more, And one day, you'll be a coding pro. To UWC computer science year two, The future is bright, and it's all up to you, So keep on coding, and never stop, You'll achieve greatness, we have no doubt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
