Search:

Type: Posts; User: m49er704

Search: Search took 0.19 seconds.

  1. Replies
    5
    Views
    1,161

    Re: String Tokenizer

    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??
  2. Replies
    5
    Views
    1,161

    Re: String Tokenizer

    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 :
  3. Replies
    5
    Views
    1,161

    String Tokenizer

    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,...
  4. Thread: Morse Code

    by m49er704
    Replies
    14
    Views
    1,511

    Re: Morse Code

    ok thanks for the info. ill come back with what i have changed later
  5. Thread: Morse Code

    by m49er704
    Replies
    14
    Views
    1,511

    Re: Morse Code

    i was thinking i had to pass the sentence through some kind of loop so i could evaluate each letter by itself
  6. Thread: Morse Code

    by m49er704
    Replies
    14
    Views
    1,511

    Re: Morse Code

    sorry. the expected output is the original string and its morse code equivilant
  7. Thread: Morse Code

    by m49er704
    Replies
    14
    Views
    1,511

    Re: Morse Code

    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 -....
  8. Thread: Morse Code

    by m49er704
    Replies
    14
    Views
    1,511

    Re: Morse Code

    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
    ........
  9. Thread: Morse Code

    by m49er704
    Replies
    14
    Views
    1,511

    Morse Code

    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
    {
    ...
  10. Re: Reading data from a file into parallel arrays

    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 =...
  11. Re: Reading data from a file into parallel arrays

    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...
  12. Re: Reading data from a file into parallel arrays

    Yes but isn't that the method you use when using scanner methods for a string?
  13. Re: Reading data from a file into parallel arrays

    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...
  14. Reading data from a file into parallel arrays

    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...
  15. Replies
    4
    Views
    781

    FOR LOOP ISSUSES

    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...
  16. Re: help with when the for loop is met and i want to run the while loop again

    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)
    ...
  17. Re: help with when the for loop is met and i want to run the while loop again

    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...
  18. Re: help with when the for loop is met and i want to run the while loop again

    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
  19. Re: help with when the for loop is met and i want to run the while loop again

    well I put

    hasWon = false; in the else statement
  20. help with when the for loop is met and i want to run the while loop again

    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...
Results 1 to 20 of 20