Search:

Type: Posts; User: Starstreak

Page 1 of 6 1 2 3 4

Search: Search took 0.08 seconds.

  1. Replies
    2
    Views
    1,354

    Re: i/o java programming help needed!!!

    So far, your code is reading in the data from the file.
    Try adding some output lines to check what it's doing.

    Follow the next step, getting the total value.

    (BTW What's in the data file?)
  2. Thread: Morse Code

    by Starstreak
    Replies
    14
    Views
    1,508

    Re: Morse Code

    I'm addressing the first error. I believe the diagnosis is correct (scope).

    There are other errors, but we usually address them starting with the first.

    Feel free to test the code yourself,...
  3. Thread: Morse Code

    by Starstreak
    Replies
    14
    Views
    1,508

    Re: Morse Code

    The scanner is not visible in the for loop because of variable scope.

    Try making the scanner static (belonging to the class).
  4. Replies
    2
    Views
    1,104

    Re: Need program checked

    Page not found
  5. Re: Beginner Coding problem in a class taught by professor with limited English comprehension

    Break the problem up and tackle and test each problem.

    1. How do we generate a random number between 1 and 10,000?
    2. Create an array to hold 10,000 numbers.
    3. How do I store only unique...
  6. Replies
    8
    Views
    1,176

    Re: Best way to use delimiter/other options

    How are you grabbing the last line of the log file? I presume the file is quite large, or may become so.
  7. Replies
    8
    Views
    1,176

    Re: Best way to use delimiter/other options

    What have you tried so far? Any code to show us?
  8. Replies
    8
    Views
    1,813

    Re: Is it a good book?

    Most of the longer Java text books are available electronically. You can try them out on Amazon or look at a friend's copy and see if you like it.;-)
  9. Re: How to assign an array cell value into a switch statement

    Java 7 allows a switch on a String, so you don't need to use a CharArray.

    A few points:

    Names of classes by convention start with a capital letter.
    Try to use descriptive variables. 'wr',...
  10. Replies
    4
    Views
    1,721

    Re: File reading issues

    The error was java.util.NoSuchElementException

    No line was found when using file.next()
    Scanner (Java Platform SE 7 )

    The while(file.hasNextLine()) loop will catch this situation, but I think...
  11. Re: An Array List of a Class that contains two other Classes

    The UML PDF doesn't open for me unless you actually download it.
    For reference, the home page is here. ADEV-1000 Programming (Java 1)
  12. Replies
    4
    Views
    1,567

    Re: hello need help with my first assignments

    Check your calculation. You need ticket_price x number_sold. Do this for each category of ticket.
  13. Re: hi if u can help me please to figure this how D become result of 1

    The answer is correct. It has to do with when the increment/decrement occurs. For a fuller explanation, please check the relevant chapter in the text you are using to learn Java or online.
    ...
  14. Replies
    78
    Views
    7,759

    Re: Queue Simulation

    The number could be the actual arrival time.
  15. Replies
    78
    Views
    7,759

    Re: Queue Simulation

    Can each customer be represented by an arrival time in a specific queue?
  16. Replies
    7
    Views
    1,223

    Re: what is the way to Calculate

    The % sign means divide the two numbers and give us only the remainder.
  17. Replies
    7
    Views
    1,223

    Re: what is the way to Calculate

    How does c = 3?

    For clarity, rewrite the code without using shorthand (augmented operators).


    int a = 1;
    int b = 2;
    int c = 3;
    a = a + 5;
    b = b * 4;
  18. Replies
    3
    Views
    986

    Re: logic error in for loops

    Rather than using a nested for loop, which tends to confuse, how about using a counter for the size of the rows.
  19. Replies
    78
    Views
    7,759

    Re: Queue Simulation

    Well, Norm seems to advocate a real time simulation, whereas I propose just calculating and accumulating known (random) time intervals. You then pump them out in one go during runtime.

    For the...
  20. Replies
    78
    Views
    7,759

    Re: Queue Simulation

    Just accumulate values you allocate and call them the time spent? Why do you need a clock if you know what the time intervals are?
  21. Replies
    6
    Views
    4,210

    Re: Reuse same Scanner to read another file

    The reset() method will reset the value of the scanner's radix to 10 regardless of whether it was previously changed. (ref)

    Does your program work or what is the error message?
  22. Replies
    1
    Views
    835

    Re: Read a specific page from .doc file

    You would probably need 3rd party libraries (Apache) to read a doc file. Even then, I'm not sure it specifies pages. I'm no expert, but doesn't it get formatted when you open it so suit your default...
  23. Re: Getting error in encoding file [ Image steganography ]

    I count at least 5 classes:
    Image_Filter
    Steganography
    Image_Panel
    Steganography_Controller
    Steganography_View

    With the panel being quite problematic.
  24. Replies
    3
    Views
    1,068

    Re: cannot return the value

    Where do you want to return the dns variable to?
  25. Replies
    7
    Views
    1,073

    Re: my code will not return everything...

    System.out.println(s);

    You can't print the 2d array with such a simple statement. You need a loop.

    How come you are using ++c (preincrement)) and not c++ ?

    BTW, the puzzle cannot be solved....
Results 1 to 25 of 136
Page 1 of 6 1 2 3 4