1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
notka56 [123]
3 years ago
6

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’ a

re in the word in order. For example, "dpoags" would be in dog-ish because dpoags. Other words like "dog", "doooooog", "pdpopgp", and "qwqwedqweqweoqweqw- gasd" would be in dog-ish. "cat", "apple", "do", "g", would not be in dog-ish.(a) 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) 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 lines
to test your code */
// System.out.println(dogish("aplderogad"));
// System.out.println(dogishGeneralized("aplderogad", "dog"));
}

// returns true if the word is in dog-ish
// returns false if word is not in dog-ish
public static boolean inDogish(String word){
return false;
}

// necessary to implement inDogish recursively
public static boolean dogishHelper(String word, char letter) {
return false;
}

// a generalized version of the inDogish method
public static boolean inXish(String word, String x){
return false;
}
}
Computers and Technology
1 answer:
Alenkasestr [34]3 years ago
7 0

//docommentifanyproblemarises //code classMain{ publicstaticvoidmain(String[]args){ /* * *leavethismain  would be some of the code. i hope this helps.

You might be interested in
To become a news anchor, you should get a Bachelor's degree in:
Sveta_85 [38]

Answer:3

Explanation:

7 0
3 years ago
Read 2 more answers
You should process the tokens by taking the first letter of every fifth word,starting with the first word in the file. Convert t
zhenek [66]

Answer:

See explaination

Explanation:

import java.io.File;

import java.io.IOException;

import java.util.Scanner;

import java.util.StringTokenizer;

public class SecretMessage {

public static void main(String[] args)throws IOException

{

File file = new File("secret.txt");

StringBuilder stringBuilder = new StringBuilder();

String str; char ch; int numberOfTokens = 1; // Changed the count to 1 as we already consider first workd as 1

if(file.exists())

{

Scanner inFile = new Scanner(file);

StringTokenizer line = new StringTokenizer(inFile.nextLine()); // Since the secret.txt file has only one line we dont need to loop through the file

ch = line.nextToken().toUpperCase().charAt(0); // Storing the first character of first word to string builder as mentioned in problem

stringBuilder = stringBuilder.append(ch);

while(line.hasMoreTokens()) { // Looping through each token of line read using Scanner.

str= line.nextToken();

numberOfTokens += 1; // Incrementing the numberOfTokens by one.

if(numberOfTokens == 5) { // Checking if it is the fifth word

ch = str.toUpperCase().charAt(0);

stringBuilder = stringBuilder.append(ch);

numberOfTokens =0;

}

}

System.out.println("----Secret Message----"+ stringBuilder);

}

}

}

5 0
3 years ago
Erik is the president and owner of Watch Out, a local website development company that helps clients create and build unique web
11111nata11111 [884]

Answer:

A. Source code

Explanation:

In the field of Programming; Source code is the code written in high level language given to the computer to translate to machine -  executable code before executing. It is usually written and understood by human. It is closer to human like language, as it allows easier expression. It is mostly consist of english-like statement.

So, Erik would primarily be writing source code when performing his daily tasks since his daily task require high level of computer programming and internet knowledge.

5 0
3 years ago
Does trend in computing important for organization management?​
mario62 [17]

Answer:

yes it is...................

6 0
3 years ago
If you play gta and don't know the song ''Glamorous'' Then what do you even do when you play?
Paraphin [41]
You literally don’t do anything you’re just like dead of sun
4 0
2 years ago
Read 2 more answers
Other questions:
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    7·1 answer
  • To support continuous improvement efforts in the workplace, you increase the number of tasks that an employee performs and have
    7·1 answer
  • With which type of social engineering attack are users asked to respond to an email or are directed to a website where they are
    9·1 answer
  • The
    6·2 answers
  • Which of the following are valid calls to Math.max? 1. Math.max(1,4) 2. Math.max(2.3, 5) 3. Math.max(1, 3, 5, 7) 4. Math.max(-1.
    9·1 answer
  • Write a C program to calculate salary raise for employees. If salary is between$ 0 < $ 30000 the rate is 7.0%If salary is bet
    8·1 answer
  • Clasifica los documentos comerciales en activo, pasivo o patrimonial para cada operacion:
    14·1 answer
  • What was the name of first computer?
    14·1 answer
  • ) Printers today have many features that include improved quality, photo printing capabilities, digital camera connectivity, bui
    11·1 answer
  • My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!