Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Binary io java help, thanks Q1. Exercise 18.4 (textbook): Write a recursive method to compute the following series and then test your code to show

image text in transcribedBinary io java help, thanks

Q1. Exercise 18.4 (textbook): Write a recursive method to compute the following series and then test your code to show m(10), m(5), m(1) 1 2 3 i + 1 Q2. Exercise 18.10 (textbook): Write a recursive method that finds the number of occurrences of a specified letter in a string using the following method header. Use a helper method to improve your code. Write a test program to test your method. public static int count (String str, char a) Q3. Write a program that searches for a specific file in a given folder and prints out the paths of all files in that folder with the given filename. If the file cannot be not found, your program should print a message "File cannot be found", where is the name of your file. Use recursion in your solution. SAMPLE RUN 1: public static void main (String[] args) find ( "Animal.java", ":/12/"); Output: C: 121 HappyFarm\ver 6 Animal.java C: 1121 HappyFarm ver 7 Animal.java SAMPLE RUN 2: public static void main (String[] args) find ('' dummy.txt " , ":/121/"); Output: Cannot find dumm y.txt Q4. Write a recursive method that returns the number of all occurrences of a given word in all the files under a directory. Write a test program. Use the following header: public static long findInFile (File file, String word)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago