subject
Engineering, 07.03.2020 03:02 sara24starling

Let’s define a new language called dog-ish. A word is in the lan- guage dog-ish if the word contains the letters ’d’, ’o’, ’g’ are in the word in order. For example, "dpoags" would be in dog-ish because dpoags. Other words like "dog", "dg", "pdpopgp", and "qwqwedqweqweoqweqw- gasd" would be in dog-ish. "cat", "apple", "do", "g", would not be in dog-ish.

(a) (20 points) Define the method inDogish recursively such that it re- turns true if the word is in dog-ish and false if it is not. I left a dogishHelper method, which I guarantee you will need to recursively solve dogish. An iterative solution will receive no points.

(b) (20 points) Define the method inXish that does the same logic of dog- ish but for some word X. The method returns true if the word contains all the letters in the word X. The solution must be recursive. An iterative solution will receive no points.

class Main {public static void main(String[] args) {/* leave this main method blank but feel free to uncomment below linesto test your code */// System. out. println(dogish("aplderogad"));// System. out. println(dogishGeneralized("aplderog ad", "dog"));} // returns true if the word is in dog-ish// returns false if word is not in dog-ishpublic static boolean inDogish(String word){return false;} // necessary to implement inDogish recursivelypublic static boolean dogishHelper(String word, char letter) {return false;} // a generalized version of the inDogish methodpublic static boolean inXish(String word, String x){return false;}}

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Aplate clutch has a single pair of mating friction surfaces 250-mm od by 175-mm id. the mean value of the coefficient of friction is 0.30, and the actuating force is 4 kn. a) find the maximum pressure and the torque capacity using the uniform-wear model. b) find the maximum pressure and the torque capacity using the uniform-pressure model.
Answers: 3
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
question
Engineering, 04.07.2019 19:10
With increases in magnification, which of the following occur? a. the field of view decreases. b. the ambient illumination decreases. c. the larger parts can be measured. d. the eyepiece must be raised.
Answers: 1
You know the right answer?
Let’s define a new language called dog-ish. A word is in the lan- guage dog-ish if the word contains...
Questions
question
Mathematics, 27.06.2019 13:00
question
Mathematics, 27.06.2019 13:00
question
Mathematics, 27.06.2019 13:00
Questions on the website: 13722363