subject

Write a program that prints all nonempty substrings of a string, in decreasing length, starting with the substrings at the front of the string. for example, if the string is "fred", you print

fred
fre
red
fr
re
ed
f
r
e
d
given:

import java. util. scanner;
public class printallsubstrings
{
/**
prints all non-empty substrings of a given word in decreasing
length, starting with the substrings at the front of the string.
@param word the word whose substrings are to be printed.
*/
public static void printallsubstrings(string word)
{
. .
}

public static void main(string[] args)
{
scanner in = new scanner(system. in);
system. out. print("enter a word: ");
string input = in. next();
printallsubstrings(input);
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
What is the first step in creating a maintenance ?
Answers: 2
question
Computers and Technology, 22.06.2019 09:00
Which best describes the condition under which the unicode output is the same as plain text?
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
You know the right answer?
Write a program that prints all nonempty substrings of a string, in decreasing length, starting with...
Questions
question
World Languages, 31.10.2019 18:31
Questions on the website: 13722359