Using java Programming language I have to write a class names Slide: For this cl
ID: 3616924 • Letter: U
Question
Using java Programming language I have to write a class names Slide: For this class, provide a constructor, appropriateaccessor/mutator methods for obtaining a specific line of text, andfinally an implementation of the toString() method which simplyreturns a String that represents the text of the slide as it wouldappear when printed on the screen. The text of the slide should bestored in a String array with its size being represented by a finalvariable called LINES_PER_SLIDE, which should be equal to 5. Theaccessor method for the slide's text should take a parameter oftype int that is between 1 and 5, inclusive, to determine whichline of slide's text is being requested (ie, if the parameter is 1the return value should be the first line of text, 2 should returnthe second line of text, and so on and so forth). The mutatormethod should accept two parameters, with one representing the newtext that will replace a given line and the second one representingwhich line is going to be changed (once again, an int between 1 and5, inclusive). These methods will require error checking to makesure that the line number being requested is within the validrange. The toString() method should return a result composed of thelines of text put together in the correct order with any newlinecharacters such that, when the method's result is printed, thelines of text would each appear on its own line.i did this: String slideText[]= newString[LINES_PER_SLIDE];
but that just gives me an array thats capable ofholding 5 strings.. how can i create an array and store 5 lines perbox in each array?
I have to write a class names Slide: For this class, provide a constructor, appropriateaccessor/mutator methods for obtaining a specific line of text, andfinally an implementation of the toString() method which simplyreturns a String that represents the text of the slide as it wouldappear when printed on the screen. The text of the slide should bestored in a String array with its size being represented by a finalvariable called LINES_PER_SLIDE, which should be equal to 5. Theaccessor method for the slide's text should take a parameter oftype int that is between 1 and 5, inclusive, to determine whichline of slide's text is being requested (ie, if the parameter is 1the return value should be the first line of text, 2 should returnthe second line of text, and so on and so forth). The mutatormethod should accept two parameters, with one representing the newtext that will replace a given line and the second one representingwhich line is going to be changed (once again, an int between 1 and5, inclusive). These methods will require error checking to makesure that the line number being requested is within the validrange. The toString() method should return a result composed of thelines of text put together in the correct order with any newlinecharacters such that, when the method's result is printed, thelines of text would each appear on its own line.
i did this: String slideText[]= newString[LINES_PER_SLIDE];
but that just gives me an array thats capable ofholding 5 strings.. how can i create an array and store 5 lines perbox in each array?
Explanation / Answer
b) Create an inner class for making an object which holds fivestrings, store the objects in the array.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.