Search:

Type: Posts; User: dx2731

Search: Search took 0.38 seconds.

  1. Replies
    7
    Views
    247

    Re: Whats wrong with this for loop?

    Sorry, I still dont understand. how does it simplify the code? and how is any calculations associated with the helper?

    --- Update ---

    Please help someone, im sick and I have to had in this crap...
  2. Replies
    7
    Views
    247

    Re: Whats wrong with this for loop?

    Okay now I have this code:


    public class climate
    {
    public static void main(String[] args)
    {
    //constants for calculating emissivity
    final double SOLAR_CONSTANT = 1367;...
  3. Replies
    7
    Views
    247

    Re: Whats wrong with this for loop?

    I figured it out now. I guess our lecturers dont make themselves very clear :/
  4. Replies
    7
    Views
    247

    Whats wrong with this for loop?

    I have this code here:


    for(C0 = 280.0; C0 <= 400.0; C0 = C0 += 5)
    {
    Carbondep = A + B*Math.log(C0/PRE_CARBON);

    //formula to calculate...
  5. Thread: User Input help

    by dx2731
    Replies
    3
    Views
    227

    Re: User Input help

    I dont have anything at the moment because I dont know where to start. So being quite specific, I need an example of the code that will get user input, A specific word such as apple. The the program...
  6. Thread: User Input help

    by dx2731
    Replies
    3
    Views
    227

    User Input help

    I wish to know how I can allow a user to input a name, and 2 numbers (such as 0.5 and 1234.0) and the code returns an answer.
    I have the rough idea as:

    get user input
    search
    retrieve and print...
  7. Replies
    3
    Views
    229

    Re: making a return for a game

    I know its missing, its just the part of the code I dont know what to put in it. like How do I get it to score each player with those numbers. As I said, even when writing down I have no clue
  8. Replies
    3
    Views
    229

    making a return for a game

    I have this dilema
    • Players simultaneously choose a move: ‘c’ or ‘d’
    • If both choose ‘c’, they get $3 each
    • If both choose ‘d’, they get $1 each
    • If one chooses ‘c’ and one chooses ‘d’, the...
  9. Replies
    6
    Views
    642

    [SOLVED] Re: Scanner closed error

    Thankyou so much! Now I see what I did wrong xD
    The code works as it should :) :) :)
  10. Replies
    6
    Views
    642

    [SOLVED] Re: Scanner closed error

    How would this look in my code above?
    Because I have tried and it doesnt work. I might be doing something wrong.
  11. Replies
    6
    Views
    642

    [SOLVED] Re: Scanner closed error

    Sorry, I had the original file and now all i need is how to get a message displayed when there is no match in the file. I put something like this as a test:


    ...
  12. Replies
    6
    Views
    642

    [SOLVED] Scanner closed error

    What would be the problem with this code?


    import java.io.*;
    import java.util.Scanner;

    /**
    * Write a description of class capital here.
    *
    * @author (your name)
  13. Re: java.util.NoSuchElementException: null (in java.util.Scanner) Need help please?

    Im doing the same assignment, same error
  14. Thread: Boolean help

    by dx2731
    Replies
    2
    Views
    186

    Boolean help

    I need to use a boolean variable to keep track of whether any countries were found, and then check this with an “if”
    statement at the end within this code.



    import java.io.*;
    import...
  15. Replies
    9
    Views
    400

    Re: Help with class, interface, enum

    I fixed my problem and everything works now.
  16. Replies
    9
    Views
    400

    Re: Help with class, interface, enum

    I've tried and I still get the same error, Could you help edit and check please?

    --- Update ---

    I now have this code, still same error:



    import java.util.Scanner;
    /**
  17. Replies
    9
    Views
    400

    Re: Help with class, interface, enum

    Im sorry all I could find is this, and it not even close to what you have:

    Class documentation
    <---- javadoc command: ---->
    C:\Program Files\Java\jdk1.7.0_15\bin\javadoc.exe
    -author
    -version...
  18. Replies
    9
    Views
    400

    Re: Help with class, interface, enum

    How do I do this? There is no text. I get this though:

    1930
  19. Replies
    9
    Views
    400

    Re: Help with class, interface, enum

    I dont know how to do this... Im writing the program with blue j.
    its the line here thats the issue:

    private static(problem here) boolean ask(String question, Scanner keyboard)

    I know for...
  20. Replies
    9
    Views
    400

    Help with class, interface, enum

    I just finished this guessing game and I have completed the first part
    (answerIsCorrect = ask("Is it a Kiwi? ", keyboard);
    and compiled it with no errors and works. Then I did the same with the...
  21. Replies
    4
    Views
    606

    Re: Guessing game help

    I got the program, will be asking for help in whats wrong with my code, thankyou for the help
  22. Replies
    4
    Views
    606

    Re: Guessing game help

    please help im desperate :(

    and also i have two public static void main(String[] args) in my code sorry.
  23. Replies
    4
    Views
    606

    Re: Guessing game help

    Please could you give a sample of one of my paths? because i have tried everything and when i test it, it just doesnt work. especially because i cant get past three questions and three animals :(
Results 1 to 23 of 24