anonymous
  • anonymous
Does anyone know Java here? I am stuck almost to the kingdom come.
Mathematics
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
khan academy should help
anonymous
  • anonymous
if not, code academy
anonymous
  • anonymous
Alright. But a little bit of live help would be great as well:)

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
okay what do you need help with?
anonymous
  • anonymous
writing a program that allocates a file in hard drive and regulates the lines in it.
anonymous
  • anonymous
sorry, I only know basic coding... I'll tag someone
anonymous
  • anonymous
@ganeshie8
anonymous
  • anonymous
Write ReadZILLA a program that will read a file called message.txt that contains ten lines of text. The program should determine the total number of words in the text, the number of vowels in each line and the average number of words per line.
anonymous
  • anonymous
I am stuck with this question.
Nnesha
  • Nnesha
ello! post your question here http://openstudy.com/study#/groups/Computer%20Science hm i think @e.mccormick , @wio or ganesh can help
Empty
  • Empty
I know Java I can help you with this.
Nnesha
  • Nnesha
^
anonymous
  • anonymous
Amazing!!!
Empty
  • Empty
You lucked out haha. Ok so how are you expected to do this, did they tell you anything about the Java IO classes? Depending on how basic they want you to do it, I might end up giving you a more advanced solution than you're ready for, so you might not want to use BufferedReader right now for instance depending on what your class wants.
anonymous
  • anonymous
Yeah I am learning about IO exception, buffer reader etc
Empty
  • Empty
``` public static void main(String... args){ helpMe(); } ``` You can type code like that with three of these symbols above and below your code `
Empty
  • Empty
Ok so specifically what do you need help with, or you can go ahead and post whatever code you might have or might think you need or whatever, let's dive in. Or if you're having trouble thinking up like "how do I make it identify words?" I can help with that too, so just whatever you need help with since there's a lot of ways this can go wrong I don't wanna like help with stuff you already know if you get me haha.
anonymous
  • anonymous
ok
anonymous
  • anonymous
import java.io.*; public class While { @SuppressWarnings("resource") public static void main(String[] args) throws IOException { String line; BufferedReader write; write= new BufferedReader(new FileReader("message.txt.docx")); line = write.readLine(); while(line != null) { System.out.println(line); line = write.readLine(); } }
anonymous
  • anonymous
That's the base for my assignment
anonymous
  • anonymous
import java.io.*; public class While { @SuppressWarnings("resource") public static void main(String[] args) throws IOException { String line; BufferedReader write; write= new BufferedReader(new FileReader("message.txt.docx")); line = write.readLine(); while(line != null) { System.out.println(line); line = write.readLine(); } } }
Empty
  • Empty
I see, so they are giving this to you and you have to "find the bugs" or are you "just adding to it"?
anonymous
  • anonymous
Sorry for posting twice
anonymous
  • anonymous
I am modifying and adding bits by bits
anonymous
  • anonymous
Create message.txt in notepad. Write ten lines of text making sure to press enter at the end of each line. Using the problem solving process (IPO chart, menu planning, pseudo code for each menu option) analyze this problem. Design a solution — write java on paper for each method Be sure to properly indent and internally document the program (include comments).
anonymous
  • anonymous
This is the full instruction
anonymous
  • anonymous
I finished writing the random ten lines and saved it as "message.txt."
anonymous
  • anonymous
However I am slightly stuck as to "using the problem solving process" due to the plethora of options here.
Empty
  • Empty
Hmmm well I don't know what "the problem solving process is" unfortunately, but I can already see you have some problems going on here. It sounds like they want you to systematically go through this to eliminate bugs.
anonymous
  • anonymous
I'll just stick with pseudo code on a different page .
anonymous
  • anonymous
But the major problem here is modifying the base code to fill the expectations for this program.
Empty
  • Empty
For instance, the name of the class is "While" which doesn't really make sense to me, similarly you have named your buffered reader strangely (why not call it 'read'?): ``` BufferedReader write; ``` Another awkward thing happening is in the next line: ``` write= new BufferedReader(new FileReader("message.txt.docx")); ``` Look at what you have in that string, .txt.docx seems to be quite strange? I am just noticing these few things but there are probably other strange things happening here as well.
anonymous
  • anonymous
Sorry I made it under a class already used previously to conform with the name rules. That's just out of the blue for my novice .
anonymous
  • anonymous
I might have to recompile the program from what it seems .
anonymous
  • anonymous
I'll give it my best shot.
Empty
  • Empty
Ohhh ok, I am just trying to make sense of everything here since I am not on the same page as you yet haha. Alright cool, I'll be here to help out, if you can ask more precise questions I'll be able to give you a better answer.
anonymous
  • anonymous
Thanks so much! Your name is such a counterclaim to who you are:)
anonymous
  • anonymous
So given that my program needs to allocate the file with the name "message.txt", as well as determine the number of words in the text, number of vowels in each line and average number of words each line
anonymous
  • anonymous
It is necessary that I create a separate file with that specified name of "message.txt" which I already did with the following.
anonymous
  • anonymous
Computer science. Science of modern age. Without computers, World will face a doom. They facilitate our lives, as well as our data. Huge multibillion industry going nuts with computers. Make sure you all Know how to use computers.
anonymous
  • anonymous
Hence with the above the requirement of making "message.txt" is filled.
anonymous
  • anonymous
the file is saved in my hard drive, which is to be extracted by Java via Eclipse...
anonymous
  • anonymous
And hence after the Eclipse will determine the given aspects-number of words per line, number of vowels, and average number of words per line respectively .
anonymous
  • anonymous
This is my reasoning for the assignment until now. Am I on the right track?
anonymous
  • anonymous
organizing the structures with the program is hard..
Empty
  • Empty
I see, sorry I was distracted by something and lost track let me catch up to where you are haha.
anonymous
  • anonymous
No problem at all! You are more than generous in being here
anonymous
  • anonymous
You seem quite into physics and math lol
anonymous
  • anonymous
As I said over and over the instruction is full of inconsistencies
anonymous
  • anonymous
But I hope to pull off something solid out of it though
anonymous
  • anonymous
Can you visualize the codes? I am nowhere close to being that proficient..
Empty
  • Empty
Ok well first things first I'll comment on what you've done so far and then I'll tell you a little about how I approach programming now and what it was like learning it about two years ago. So what Eclipse does is really nothing. It's more like just a "spell checker for code" and it helps you create stuff easier. But when you do stuff, you're writing Java code and then Eclipse just makes it easy to compile and run your code. Compiling code just means that it turns it from what you can read into something that the computer can read, since the computer doesn't actually run the code you write, it has to get translated. In addition to that, when code is compiled it tends to get optimized to become faster. What I mean by saying all that is that you will have to write code to extract the number of words and spaces and vowels in your Java code, Eclipse won't do that sort of thing for you. So you're on the right path with what you've done so far I think for the most part, now you must use the BufferedReader to find what you want. I suggest (although it will seem very overwhelming to you now try to just do your best) looking at the Java docs. http://docs.oracle.com/javase/7/docs/api/java/io/BufferedReader.html Just try to get familiar with it. Every time you use something new, try to look up the Javadocs to get a feel for what you can do with it, it will help in solving problems later if you can think "Oh I remembered there was such and such method that I might be able to use." The second thing I wanted to say about like visualizing code and stuff I'll say in a moment I'm still sorta distracted.
anonymous
  • anonymous
Thanks so much for your tips. I will definitely use my problem solving skill to approach the problem one way or the other I mean there has to a way right? I will definitely use your link and see what I can salvage off it. And to that distraction part we all struggle with it you are not the only one:)
anonymous
  • anonymous
Obviously there is going to be throwing about of brains but I'll let you know how it goes.
anonymous
  • anonymous
Buffer reader-System that allows for reading of input stream. Arrays, lines, and characters are all processed by Buffer readers.
anonymous
  • anonymous
One additional knowledge to my brain lol
anonymous
  • anonymous
well, right now, you're just reading every line from message.txt.docx and dumping it to the standard output stream. it seems the goal is to instead write a program to *write* ten lines of text to message.txt
anonymous
  • anonymous
now, you're familiar with `BufferedReader` but I think you should also check out documentation on `BufferedWriter` and specifically wrapping it in a `PrintWriter`: https://docs.oracle.com/javase/8/docs/api/java/io/BufferedWriter.html
anonymous
  • anonymous
this will help you write rather than read lines from a text file. consider: ``` final PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter("message.txt"))); /* example: write "hello" to the file */ writer.println("hello"); /* now clean everything up */ writer.close(); ``` also instead of signaling the compiler to suppress warnings, you should just listen to it and make sure you clean up after yourself and release any resources (like the file handle you've acquired for reading/writing to a file)
anonymous
  • anonymous
alternatively you can use the Java 7 NIO.2 file API to acquire a writer: ``` import java.nio.file.Path; import java.nio.file.Files; ... final Path path = Paths.get("message.txt"); final PrintWriter writer = new PrintWriter(Files.newBufferedWriter(path)); ```

Looking for something else?

Not the answer you are looking for? Search for more explanations.