Answered step by step
Verified Expert Solution
Question
1 Approved Answer
***Please answer the following using Java Eclipse, Thank You! ***Must use the lines of code provided within your code, you do not need to use
***Please answer the following using Java Eclipse, Thank You!
E13.2 Given a class Square with an instance variable width, provide a recursive getArea method. Construct a square whose width is one less than the original and call its getArea method. E13.8 Use recursion to implement a method public static boolean find(String text, String str) that tests whether a given text contains a string. For example, find("Mississippi", "sip") returns true. Hint: If the text starts with the string you want to match, then you are done. If not, consider the text that you obtain by removing the first character. Provide one source file (java) for one question. Hence, total two *.java files need to be submitted. To help your work, incomplete source files are attached. Use the provided source files to answer the questions. Square.java and Sentence.java are for E13.2 and E13.8, respectively. In modifying the source files, 1. 2. Do not change the file (class) names. Points will be deducted if you have different names. Fill in your name in the @author section of the comment in each of the files. If you do not, points will be deducted. Note that demo files (testing your classes) are provided. You do not need to submit these demo files (SentenceDemo.java and SquareDemo.java). Note also that your class should be able to give correct outputs with different inputs. Submit your work to Canvas. Make sure to submit source files(.java). Class files(".class) will not be graded and receive zero credit ***Must use the lines of code provided within your code, you do not need to use the demo files.
***Please follow the directions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started