Hello, I'm too new to overflow piles, so I hope I'm doing this correctly and there Someone needs answers.
One of the questions I am currently coding at a program with Eclipse IDE in Java is:
I need a snippet that does the following
It is considered to have obtained a .ttt file containing the text and out of it.TTT file counts the number of rows and prints it, calculates the number of words and prints it, the letters Calculating the number And print it. And finally make a list of the top 10 words and print them.
The printing system is done to print out
I am very new to Java and I am having some problems
Anyone from there Can I provide these lines of code or know where I can find them?
Thanks to everyone
sorry that the edit button was not found ...
I added this to my question:
Hey, this is an assignment, but homework is not working, well, I can see well what I have done so far, I think I am very close but it is not working for me. Do not I miss anything?
// Class tip import java.io. *; Import java.util. *; Square tip {public static zero principal (string [] args) throws an exception {string root = system.jetproperty ("user.dir"); InputStream = new FileInputStream (root + "\\ tip.txt"); Scanner scan = new scanner (is); String thampstring = ""; Int lines = 0; Int word = 0; Of vector & lt; Integer & gt; WordLength = new vector & lt; Integer & gt; (); Int avarageWordLength = 0; While (scan.hasNextLine () == true) {tempString = scan.nextLine (); Lines ++; } is close(); = New FileInputStream (root); Scan = new scanner (is); While (scan.hasNext () == true) {tempString = scan.next (); WordLength.add (tempString.length ()); Word ++; } (Integer I: wordLength) {avarageWordLength + = i; } AvarageWordLength / = wordLength.size (); System.out.println ("lines:" + lines); System.out.println ("word:" + word); System.out.println ("accretion length of words:" + avarageWordLength); is close(); }}
It seems a lot like guaranteeing completion of homework Answer is done, but I give you some suggestions to view the Java API:
File reader and buffered reader to get the data To store your data, archive APIs store a custom data structure to store your list once you start working and are doing some work and need special help, then come back with specific questions here. And then we count the words and events to figure out the top 10 list to sort out our data structure. Comparative or Comparative
Good luck!
Comments
Post a Comment