Bobby Morrison

Greenhorn
+ Follow
since Feb 17, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bobby Morrison

I'll post everything I have so far.

The code might make a bit more sense.

HTML


CSS


JAVASCRIPT


Hope this helps.
I've played around a little with my stylesheet, yet no luck.

Hello world,

Been working on this FizzBuzz app today.

I am having problems changing the color of the numbers that appear whilst the game is in play.

I would like to change it from black to white.



If anyone can help, I would be very grateful.

Thanks.
How can I use Arrays to match the characters in the text file?

7 years ago
Any pointers on where I should go next with this?
7 years ago

Knute Snortum wrote:If you want to call the methods in the class you've written, don't put "Files." in front of them, just write:



Thank you! That was so simple. At least it wasn't a curly bracket this time! Haha
7 years ago

Campbell Ritchie wrote:Please search for Morse code in this forum; I think two other people seem to have the same assignment. Are you all at the same College?

Why are all three of you using readers and the File class and the exists method? I would use a Scanner and Formatter myself. Why are you using the old method of explicitly closing the readers when you could use try with resources instead? Why am I getting déjà vu about this question? Has somebody else posted exactly the same code Or was it you?
I am sure the exists tests (lines 18 and 61) and the create call (line 61) are unnecessary. If there are any problems, let the exception handling deal with that. If you have problems with exists(), you won't enter the block and you won't know what is wrong.
The Files class doesn't seem to have methods with the names you are using. Have you got your own Files class? I think those calls shouldn't be there. Or anywhere else. I can't see what you need which is outwith that class in the first place. What you need is to read the file, split the text, decide whether it is clear of code, translate it and then write to the new file.
Why have you marked your methods static? Why are you giving that array protected access? I think both those things are mistakes.



This would have been me. I've been trying to do this for a while and posted a previous attempt in this forum before. It wouldn't be a surprise if someone from my college had posted already, a lot of us are struggling.

We're expected to do it with the methods he has taught us. So it's should be something like this... BufferedReader/Writer to read and write the file and 2 sets of the arrays to translate the ".-." to "a".

Although somebody else has attempted it with a scanner and it seemed to be acceptable.
7 years ago

Norm Radder wrote:

I've ended up with some of the dreaded red squiggly lines  


Do you get compiler errors that you can copy and paste here to show the errors?
Compiler error messages are usually good at describing the problem.



When you say "compiler errors" would I be right in thinking "debug"?

MorseDecoder [Java Application]
morse.MorseDecoder at localhost:49193
Thread [main] (Suspended (The method readFile(String) is undefined for the type Files))
MorseDecoder.main(String[]) line: 98
C:\Program Files\Java\jre1.8.0_121\bin\javaw.exe (19 Mar 2017, 13:32:46)
7 years ago
Hello world, I need some help!

I've been given a collage task, read a message written in Morse code from a text file and covert it into English, then write it to another text file.

At the moment I am just trying to read the Morse and write it to a file but I've ended up with some of the dreaded red squiggly lines on my last 2 lines. "readFile" and "writeFile".

Does anyone know where I'm going wrong with this?

7 years ago
Hi guys, I'm back and starting from scratch.

Basically what I am trying to do now is to take some Morse code from a text file using a Buffered Reader and then write it to a separate file using File Writer.

I'm gonna need to use a Split Method to separate the ",".

I'm also wanting 2 Arrays (English, Morse) to help translate the message.

But I'm stuck, already.

How do I fix this?


7 years ago
Thank you all for your replies so far.

I'll be going through all this over the weekend and hopefully get things up and running.

I have came across the "Switch" and "Hashmap" whilst trying to do this but I'm really trying to have a program that reads from an "Array" and a "Text File". Every time it's the "if (user.charAt(i) == '.-')" that is slipping me up.

Once again thanks, I'll post my results.

P.S, I'm still very much a beginner with this.
7 years ago
Hello everyone,

I am having a little trouble converting Morse to English in Java.

I have this code based on English to Morse but cannot work out how to make it Morse to English.

If anyone can point out where I've gone wrong, I would very much appreciate it.

Thanks.

7 years ago