Search:

Type: Posts; User: Mugambbo

Page 1 of 2 1 2

Search: Search took 0.36 seconds.

  1. Re: How do I get my program to read .txt files? My code doesn't work. Can you please post your code? I use eclipse.

    I suggest you employ Java's File and Scanner class. They are pretty easy to use for beginners.
  2. Replies
    11
    Views
    206

    Re: Java Program: Falling Distance Problem

    One line of your code in your for loop skips the first result and that is: fallingTime++; I'll suggest you use: System.out.printf() to format the distance output, if thats more easier.
  3. Replies
    1
    Views
    74

    Re: Fibonacci Sequence Code in Java

    Could you show us all of the codes you've written already and the errors/exceptions you discovered. This is so we don't spoon-feed you
  4. [SOLVED] Re: If you can, show me what i am doing wrong

    Please post the errors you get when you run the codes. Btw, your use of o for 0 wouldn't work as a position holder in an array.
  5. Replies
    1
    Views
    173

    Re: Can anyone help me with java code

    Tell us what errors you are getting and then post the full error message here. Also, tell us whether the result wasn't what you were expecting and what you expect of it.
  6. Replies
    2
    Views
    167

    Re: java (file handling issue)

    I doubt if this is possible without Java's Apache POI. Java POI Try a google search.
  7. Replies
    4
    Views
    253

    Re: Specifying the file location

    Specify a separate location for your output file e.g. C:\Users\[PC_NAME]\Desktop\hello.txt
    This should work on a Windows PC
  8. Re: Hi there! I have a project and I need your help dear friends :D

    In order that it shows all the lines in your text field, then for each iteration of your while loop, ensure you get the text currently in the field, append the next line to it by concatenation and...
  9. Replies
    3
    Views
    283

    Re: dont know how to describe the problem.

    Play again:
    Wrap your code in a while loop & ask the user if they want to play again. Whatever the input, that should be part of the condition in your while loop.
  10. Re: how do I add Action Listener to my code to make the calculator work

    You must feel a little bit frustrated alex. Be patient and Norm will help you get through this. For now, in order to keep things simple, why don't you create new objects for each button rather than...
  11. Replies
    2
    Views
    143

    Re: help with a last bit of my code!!

    Continuing from where you left off, I can only suggest that you:
    1. Declare a boolean type of truefalse first
    2. Place all your code in a while loop
    3. Don't need to create another object of your...
  12. Replies
    7
    Views
    368

    Re: Question about math.pow and math.sqrt

    Not quite ggx. Think about square root, cube root, fourth root, fifth root, etc of a number (X) as that number (X) raised to a power of 1/2 (0.5), 1/3 (~0.33), 1/4 (0.25), 1/5 (0.2), etc...
  13. Replies
    7
    Views
    368

    Re: Question about math.pow and math.sqrt

    You're absolutely correct! By the way, you are not actually multiplying the base number by 0.5, but raising the base number to a POWer of 0.5. You'll find proofs in a high school maths text book. You...
  14. Replies
    7
    Views
    368

    Re: Question about math.pow and math.sqrt

    Yes! If you want square roots, use Math.sqrt instead. However, Math.pow as you've mentioned can also get the job done. Yet, I could consider that 'illegitimate' as is the possibility of more...
  15. Replies
    5
    Views
    282

    [SOLVED] Re: oop rational number help

    Could you post the complete errors you get when you compile?
  16. Re: Do while loop to generate 6 random numbers

    Hello Bran. How about using an array to store the numbers; then using the nextInt() method from Java.util.Random in a for loop; and finally a simple if statement to ensure the numbers are unique....
  17. Replies
    6
    Views
    243

    Re: If Statement - Check for two thinks

    Well-done Nick! You seem do be doing well. I hope you have something like this after the last part of the code you posted?


    String letterInputed = userInput.next();

    If you do, your if...
  18. Replies
    6
    Views
    243

    Re: If Statement - Check for two thinks

    Hello Nicken99, you seem to be using the 'toLowerCase()' method in the wrong place. This is what you should do,

    userInput.toLowerCase().equals("h"); or you could use

    ...
  19. Replies
    25
    Views
    379

    Re: Few errors on my code.

    I appreciate your impressive criticism Greg. Will do as you suggested. Thanks anyway.
  20. Replies
    8
    Views
    259

    Re: Factorial Test Program

    @Phendrickson, if you had caught the exception (InputMismatchException) in a try catch block, it wouldn't have displayed this exception, but rather, any string of your choosing.
  21. Replies
    25
    Views
    379

    Re: Few errors on my code.

    Why I believe the Roleplaygame class couldn't locate the pmenu method was because the pmenu method was called even before the method was defined. And as java follows what is called the 'Stack Trace',...
  22. Replies
    25
    Views
    379

    Re: Few errors on my code.

    The solution should be to take the pmenu method to the Player class as the Roleplaygame cannot locate the pmenu method when the Player class was instantiated.
  23. Replies
    25
    Views
    379

    Re: Few errors on my code.

    Observation: The method public String geteverything should be declared void as it does not return anything but just prints out.
  24. Replies
    4
    Views
    575

    Re: Help with Java program: Internet Service Provider

    Hi rosiems, your code looks okay to me. It likely, whenever you run it, your input is always below the minimum i.e. 10. So, I suggest (and this is the proper thing to do) you add a last else...
  25. [SOLVED] Re: Problem trying to add a new file each time, without overwriting the previous.

    It will be wise you name your files as so:
    Q1, Q2, Q3, etc. This should enable you use the isExist() method of the File class as a condition in a while loop while incrementing the numbers in the...
Results 1 to 25 of 41
Page 1 of 2 1 2