Search:

Type: Posts; User: dmanmeds

Search: Search took 0.12 seconds.

  1. Replies
    18
    Views
    802

    Re: help with this question

    Yes " the letter is at a position of the String that is divisible by 4 "
    is related to this code

    if( s.length() % 4 == 0){


    String "Hello There!"
    gets turned into "hello there!" via s =...
  2. Replies
    18
    Views
    802

    Re: help with this question

    I need it to multiply the score by 2 , if the letter is at a position of the String that is divisible by 4 (0,4,8,16,...)
    in this case "Hello There!"
    'H' has a score of 4 but since 0 (the position...
  3. Replies
    18
    Views
    802

    Re: help with this question

    this fixed the out of bounds error I had before, when a non letter (space, comma,ect) was trying to be scored. This way, when the for loop executes
    if it comes across a non letter then it will just...
  4. Replies
    18
    Views
    802

    Re: help with this question

    I have updated it with some comments. Hope it clarifies what I was trying to do
  5. Replies
    18
    Views
    802

    Re: help with this question

    I got it to count the String with non letters.
    but when I add the if statement to try to double the value when the String is divisible by 4, it doesn't produce the correct answer
    I do not get...
  6. Replies
    18
    Views
    802

    Re: help with this question

    technically this works for adding the letters but it only works if there is no space between the words. When I put the spaces in between the words I get the out of bounds error. I tried accounting...
  7. Replies
    18
    Views
    802

    Re: help with this question

    sorry about the confusion. This is just one part of a whole big problem I have to do but assigning the letters to scores was something I was not sure how to do.
    I tried doing this but I still get an...
  8. Replies
    18
    Views
    802

    help with this question

    I am given a string "Hello World!"
    and an array, int[ ] scores = {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10};
    the scores should corresponds to letters in the alphabet a=1, b=3,c=3...
  9. Replies
    18
    Views
    1,055

    Re: help fix this code

    I think I am getting really close I have this code. this method makes it so there is a line of the specified number of tokens then creates a new line. The only problem now is that it does not include...
  10. Replies
    18
    Views
    1,055

    Re: help fix this code

    from your note I think you were trying to tell me that since the if statement is true then it won't go on to execute anything after it
  11. Replies
    18
    Views
    1,055

    Re: help with this code

    kevin-I tied to fix it up

    Norm- what kind of statement would i have to use to get it to print the token then print a line if it is divisible by a certain number? oh and yes that is the same...
  12. Replies
    18
    Views
    1,055

    help with this code

    I am trying to get my code to to print out a certain number of tokens in a line then make a new line. The number is determined by a number entered to the console. How do I get it to do this. I have...
  13. Replies
    18
    Views
    1,055

    Re: help fix this code

    Sorry for asking so many questions but I think I might me getting somewhere now. my professor told me make a TokenStore object t inside TokenDriver.

    Read in a line of text s

    Then: ...
  14. Replies
    18
    Views
    1,055

    Re: help fix this code

    would this be how a method like that looks like? I get an error with this but if I am on the right track then I could probably figure it out. Do you think I would be able to get an example of what a...
  15. Replies
    18
    Views
    1,055

    Re: help fix this code

    what i am really having trouble on is storing the tokens from TokenDriver in an array in the other class Token Store
  16. Replies
    18
    Views
    1,055

    Re: help fix this code

    right now the code asks for a line then prints the tokens, but i need it to ask for multiple lines of strings, turn them into tokens then print the tokens

    the program wants me input a number (lets...
  17. Replies
    18
    Views
    1,055

    help fix this code

    how do i get the inputed strings to print out after i turn them into tokens ? I need it to ask for a number and then multiple lines of strings, turn them into tokens, then print them out.



    ...
  18. Replies
    4
    Views
    1,044

    Re: help fix this code

    I forgot to change the class name, sorry I fixed that part now. I was having really hard trouble doing all three at once so I started by scratch but only with one dog and once I got one dog running...
  19. Replies
    4
    Views
    1,044

    help fix this code

    g
Results 1 to 19 of 20