Search:

Type: Posts; User: Nuggets

Page 1 of 3 1 2 3

Search: Search took 0.11 seconds; generated 55 minute(s) ago.

  1. Thread: Keeping Track

    by Nuggets
    Replies
    2
    Views
    1,746

    [SOLVED] Re: Keeping Track

    So simple. Sometimes asking a question will help my brain ignite to solve a problem. Thanks for responding.
  2. Thread: Keeping Track

    by Nuggets
    Replies
    2
    Views
    1,746

    [SOLVED] Keeping Track

    How would you keep track of how many times a program has ran through a loop? For example, program asks user to continue (y/n), if they enter y, program continues then asks again once finished with...
  3. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    Oh, for some reason when I was compiling, it kept printing out "BALL". So I add the nested for loop to see if that would work. I didn't change anything but remove the nested for loop again. Hm, now...
  4. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    Modified my for loop. I input "BALL" and now it outputs, "CCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM". It did increment each character by...
  5. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    The print statement is printing out the string that I input, which is "BALL". The value of i is found when binarySearch looks for the characters that is entered in as input. I have searched the input...
  6. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    System.out.print(Alphabet[i+1]);
    I came up this statement. I would print the result in the array Alphabet + 1 so it would increment it by one. But its not working. Can you help me?
  7. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    Modified For loop by adding in charAt method. It now prints what I input in letters. How would I increment the value of the input so it shifts one position to print out the next alphabet character? I...
  8. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    [QUOTE=andreas90;62722]You do that with your for loop if i'm getting it right.

    Yes, but I have to set the variable char value to something. Like how I set char value = 'C' and it found the...
  9. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    This is getting frustrating. I modified char value = 0; and changed it to char value = 'C'. Now System.out.println(result); will output 2, which is the correct value in my char Alphabet array. How...
  10. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    Well, if I do system.out.print(result + 1); it will print out 0 instead of -1.
  11. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    My value variable is set to equal 0. That's all I've done with it. It gives an error when I compile without the = 0.
  12. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    So why isn't it only returning -1 as the index for my system.out.print(result).
  13. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    int result = Arrays.binarySearch(Alphabet, value);
    This code searches for a character in the Alphabet array, then assigns it a value correct? If not, can someone please explain to me what...
  14. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    So i need to create that code for every letter in my array from A to Z? I want this program to input any string of letters, like "BALL" then increment each one of those characters to the next letter...
  15. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    if (result < 25) {
    System.out.println("val" + result);
    Output: val-1
    val-1
    val-1


    if (result == 25) {
    System.out.print(Alphabet[0]);
    Output: gives an exception on line 22.
  16. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    All it prints out is -1-1-1 for "ABC".
  17. Replies
    38
    Views
    8,393

    [SOLVED] Re: Char Array Increment + 1

    I'm entering in a txt file to convert. I thought this statement was supposed to sort the array, then search the binary number for the character. Thus I then did the if (result < 25), meaning if the...
  18. Replies
    38
    Views
    8,393

    [SOLVED] Char Array Increment + 1

    I want this program to search the user input for a character stored in an array, then increment the value of the character by 1. For example, if the input was "A", then increment that value by 1 so...
  19. Thread: File Output

    by Nuggets
    Replies
    4
    Views
    1,670

    Re: File Output

    Output a new file.
  20. Thread: File Output

    by Nuggets
    Replies
    4
    Views
    1,670

    File Output

    What method would I use to rename a file that has been entered? For example, I input a txt file named "test.txt", the program reads that file. Then it will output the file under a new name.
  21. Replies
    15
    Views
    10,606

    [SOLVED] Re: How To Increment Array Elements

    Thank you.
  22. Replies
    15
    Views
    10,606

    [SOLVED] Re: How To Increment Array Elements

    Here is newly modified for loop.


    for (int pos = line.length() - 1; pos >= 0; pos--) {
    for (int i=0; i<alphabet.length; i++) {
    if (alphabet[pos] != 'Z') {
    alphabet[pos]++;...
  23. Replies
    15
    Views
    10,606

    [SOLVED] Re: How To Increment Array Elements

    I changed println to print and it prints horizontally now. But why is my code printing my output backwards? For example, Input: "ABC", Output: "DCB". I want it to print in the same format as the...
  24. Replies
    15
    Views
    10,606

    [SOLVED] Re: How To Increment Array Elements

    Here is my modified for loop. I think I have almost solved this problem. Input example, "ABC". Output example is exactly as shown:
    "D
    C
    B"
    How would I change it so it prints horizontally like...
  25. Replies
    15
    Views
    10,606

    [SOLVED] Re: How To Increment Array Elements

    That helped a lot, thanks! I think what Aussie said made sense though. I need to take the input, rather than the array. I modified code again. Output keeps looping through the array elements and...
Results 1 to 25 of 65
Page 1 of 3 1 2 3