Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem#1. Write a recursive method eliminatelDigit which accepts a positive integer M (greater than 0 ) and a digit K and returns an integer number

image text in transcribed
Problem\#1. Write a recursive method eliminatelDigit which accepts a positive integer M (greater than 0 ) and a digit K and returns an integer number N, such that N is a new number without the K digit occurrences of M. If all M digits are equal to the K digit, then return 0 . Consider the following output examples: - Example 1: Command: eliminatedigit 117121 Output: 72 is the number without digit 1 - Example 2: Command: eliminatedigit 3324 Output: 332 is the number without digit 4 - Example 3: Command: eliminatedigit 6666 Output: 0 is the number without digit 6 Problem\#3. Write a recursive method called shuffle that accepts two strings of characters, S1 and S2. The method will return a shuffled string of S1 and S2. The shuffled string will interchange the characters of S1 and S2, respectively. So that the first character of S1 will be followed by the first character of S2, and so on. Consider the following output examples: - Example 1: Command: shuffle abod efgh output: aebfcgdh is the shuffle of abcd efgh - Example 2: Command: shuffle abc fgkl Output: afbgckl is the shuffle of abc fgkl - Example 3: Command: shuffle abcd efg Output: aebfcgd is the shuffle of abcd efg

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

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions