so should it look like this :
myDate = df.parse(hire);
--- Update ---
ok so figured a way to read the file. Only now it wont read the very last line??
Type: Posts; User: m49er704
so should it look like this :
myDate = df.parse(hire);
--- Update ---
ok so figured a way to read the file. Only now it wont read the very last line??
yes that's what I initially thought because I want each token as its own
-name
-employee number
-hire date
-shift
-pay
but when I get to the date it tells me this :
I am trying to read a file and extract all the tokens but im having a hard time programming it correctly
heres the file:
Jane Rivers, A-902, 05/16/2001, 1, 16.25
Bob Cox, S-823, 06/21/1990,...
ok thanks for the info. ill come back with what i have changed later
i was thinking i had to pass the sentence through some kind of loop so i could evaluate each letter by itself
sorry. the expected output is the original string and its morse code equivilant
that's all the code.... well except for the morse.txt file that i read into the arrays
--- Update ---
1 .----
2 ..---
3 ...--
4 ....-
5 .....
6 -....
this is a sample output
Enter the sentence that you wish to be decoded:
hello
..... .-.. .-.. --- This translates to : [C@15e83f9
..... .-.. .-.. --- This translates to : [C@15e83f9
........
hi I am writing a program that translates a string to morse code, but my output is a little strange. can anyone push me in the right direction? heres my code
public class Translate
{
...
well i edited my code to look like this with one loop
for(int i = 0; i < characters.length; i++)
{
char characs = input.nextLine().charAt(0);
String syms =...
im not quite sure. I think its reading the line at 1 in the position of the array. it goes through the loop 36 times because there are 36 lines in the file
it stores the data at position i and...
Yes but isn't that the method you use when using scanner methods for a string?
It's a program for translating a sentence into morse code. The file morse.txt
Has characters 1-9 . , ? and A-Z
And the morse code translation right next to character
I want to read the contents...
hi all,
I am having a problem reading the data from a text file into my array. it skips every other character and string in the text file
heres my code
import java.io.*;
import...
Im having problems with my for loop. The user has 3 times to roll the number that was guessed. when the condition is met on the the third try I want it to say that they won not that they lose...
still having some trouble with the x = 3 in the loop. heres how it looks now
for(int x = 0; x < 3 && hasWon == false; x++)
{
if(game1.getAnswer() == guess)
...
Oh ok I understand.
Yes I encountered that. Well I can't say if x > 3 because the loop only runs 3 times ?
I tried if(guess != getANswer()
{ "you lose"}
But that will tell you that you lose no...
no it didn't work
do you mean turning it from true back to false?
that's what it seems like its doing. when the user win it will not enter the for loop again?
im just confused on how to fix that
well I put
hasWon = false; in the else statement
when the guess is the same as the dice roll and i enter yes again it only lets me enter the guess. then its asks me if i want to go again instead of running three rolls
--- Update ---
import...