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 =...
Type: Posts; User: dmanmeds
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 =...
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...
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...
I have updated it with some comments. Hope it clarifies what I was trying to do
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...
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...
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...
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...
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...
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
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...
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...
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: ...
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...
what i am really having trouble on is storing the tokens from TokenDriver in an array in the other class Token Store
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...
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.
...
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...