Does anyone know Java here? I am stuck almost to the kingdom come.

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.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

Does anyone know Java here? I am stuck almost to the kingdom come.

Mathematics
See more answers at brainly.com
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.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

khan academy should help
if not, code academy
Alright. But a little bit of live help would be great as well:)

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

okay what do you need help with?
writing a program that allocates a file in hard drive and regulates the lines in it.
sorry, I only know basic coding... I'll tag someone
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.
I am stuck with this question.
ello! post your question here http://openstudy.com/study#/groups/Computer%20Science hm i think @e.mccormick , @wio or ganesh can help
I know Java I can help you with this.
^
Amazing!!!
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.
Yeah I am learning about IO exception, buffer reader etc
``` public static void main(String... args){ helpMe(); } ``` You can type code like that with three of these symbols above and below your code `
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.
ok
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(); } }
That's the base for my assignment
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(); } } }
I see, so they are giving this to you and you have to "find the bugs" or are you "just adding to it"?
Sorry for posting twice
I am modifying and adding bits by bits
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).
This is the full instruction
I finished writing the random ten lines and saved it as "message.txt."
However I am slightly stuck as to "using the problem solving process" due to the plethora of options here.
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.
I'll just stick with pseudo code on a different page .
But the major problem here is modifying the base code to fill the expectations for this program.
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.
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 .
I might have to recompile the program from what it seems .
I'll give it my best shot.
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.
Thanks so much! Your name is such a counterclaim to who you are:)
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
It is necessary that I create a separate file with that specified name of "message.txt" which I already did with the following.
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.
Hence with the above the requirement of making "message.txt" is filled.
the file is saved in my hard drive, which is to be extracted by Java via Eclipse...
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 .
This is my reasoning for the assignment until now. Am I on the right track?
organizing the structures with the program is hard..
I see, sorry I was distracted by something and lost track let me catch up to where you are haha.
No problem at all! You are more than generous in being here
You seem quite into physics and math lol
As I said over and over the instruction is full of inconsistencies
But I hope to pull off something solid out of it though
Can you visualize the codes? I am nowhere close to being that proficient..
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.
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:)
Obviously there is going to be throwing about of brains but I'll let you know how it goes.
Buffer reader-System that allows for reading of input stream. Arrays, lines, and characters are all processed by Buffer readers.
One additional knowledge to my brain lol
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
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
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)
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)); ```

Not the answer you are looking for?

Search for more explanations.

Ask your own question