2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by bigbags911
0

can u write the complete code so that it will be easy to find out what exactly you are trying to do

0

can u write the complete code so that it will be easy to find out what exactly you are trying to do

import java.io.*;
import java.util.*;

public class Homework10 {

Scanner input = new Scanner(new File("backwards.txt"));

private String reverse_word(String word) {
String new_word = "";
for(int i=word.length()-1; i>=0; i--) {
new_word += word.charAt(i);
}
return new_word;
}

private String reverse_sentence(String sentence) {
String new_sentence = "";
String[] toks = sentence.split(" "); 
for(int i=toks.length-1; i>=0; i--) {
new_sentence += " " + reverse_word(toks[i]);
}
return new_sentence;
}
}

I want to type a number in then i want it to do a keyword search in the text file they return what ever keyword it finds in text file

Edited by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.