[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Joanne
The word error is from the catch. I think the reason the word error appears ...
Shen anigans wrote:I tried assigning x to the switch statement but it just gives me error. Is there any way to use br.readline w/o the try and catch?
Joanne
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Jay Watson wrote:I got the program running.It works fine, But is there any other way other than switch statement?
One other thing. You can replace your whole switch statement with one line of code. Notice that when 'y' is 1, you print out the value of morse[0], when 'y' is 2, you print out the value of morse[1], etc. Can you see a pattern ?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ulf Dittmer wrote:There may other problems, but instead of "sentence.charAt(0)" you should have "sentence.charAt(i)".
Karthick D V
Jay Watson wrote:Why won't it read space?
Only when there was no risk of it being used as cheating for the assignment. I am sure you had it worked out, didn't yousalvin francis wrote:you finally said it
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|