Answered step by step
Verified Expert Solution
Question
1 Approved Answer
it should be in Java language update ( this is the whole question, can you tell me what information you need more?) this is the
it should be in Java language
update
( this is the whole question, can you tell me what information you need more?)
this is the wwww
Problem#3. Write a recursive method called isPatternStringOIN that accepts two parameters, a string of characters, str, and a length of a pattern, n. The method will return a Boolean value which indicate whether the string is entirely composed of repeated occurrences a pattern of length n or not. The method returns true only if the string is entirely formed of repeated occurrences of a substring of length n. Otherwise, it returns false. Consider the following output examples: Example 1: Command: ispatternStringOEN abcdabcd 4 Output: abcdabcd is a composed of a pattern of size 4 Example 2: Command: isPatternStringOEN abcdabcd 3 Output: abcdabcd is not composed of a pattern of size 3 Example 3: Command: isPatternStringOEN abcdabcde 4 Output: abcdabcd is not composed of a pattern of size 4 Input File Format and Specifications: You will read the command from the input, called "input.in.txt", which is attached in this assignment. You should open and read this file automatically in the main program without prompting the user to enter the name of the input file. The first line of the input file will contain one positive integer, which represents the number of commands (lines) following that line in the input file. Each of the following n lines in the input file contains a command, which is followed, in the same line, by the required parameters. The commands of the 3 recursive methods, and their required parameters data, are described below: nthMultipleof: This command will be followed by two integers, a and b. findSmallest: This command will be followed by a set of integers numbers which are separated by':'. isPatternStringOEN : This command will be followed by a string, and pattem length n. Output File Format and Specifications: Your program must produce an output file, called "output.out.txt". You must follow the exact format of the output file. Please refer to sample output file for output format and specifications. 8 nthMultipleof 117 9 nthMultipleof 145 9 nthMultipleof 145 5 findsmallest 21;6; 145;26; -2; 0; 19;243;15 findsmallest 21;6; -145; 26; -2;0;19;243;15 isPatternStringofn abcdabcd 4 isPatternstringofn abcdabcd 3 isPatternStringofn abcdabcde 4 Input File Commnad: nthMultipleof 117 9 Output: 117 is the 13-th multiple of 9 Commnad: nthMultipleof 145 9 Output: 145 is not a multiple of 9 Commnad: nthMultipleof 145 5 Output: 145 is the 29-th multiple of 5 Commnad: findSmallest 21; 6;145;26; -2;0; 19; 243;15 Output: The smallest number is: -2 Commnad: findSmallest 21;6;-145; 26; -2;0; 19;243;15 Output: The smallest number is: -145 Commnad: ispatternstringofn abcdabcd 4 Output: abcdabcd is a composed of a pattern of size 4 Commnad: ispatternstringofn abcdabcd 3 Output: abcdabcd is not composed of pattern of size 3 Commnad: ispatternstringofn abcdabcde 4 Output: abcdabcd is not composed of a pattern of size 4 output fileStep 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