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 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
You know the right answer?
Write a program that prints all nonempty substrings of a string, in decreasing length, starting with...
Questions
question
Mathematics, 04.02.2020 10:48
question
Mathematics, 04.02.2020 10:48
Questions on the website: 13722367