Search:

Type: Posts; User: camel-man

Page 1 of 14 1 2 3 4

Search: Search took 0.66 seconds.

  1. Re: Getting the wrong values when calculating perimeter and area

    There are multiple ways you can go about doing it. One way is by making a separate constructor for your report class that takes a triangle object as its parameter. Then you can pass in your triangle...
  2. Re: Getting the wrong values when calculating perimeter and area

    Your report class is creating its own triangle instance, which has nothing to do with the triangle you create and manipulate in your main class.
  3. Re: Getting the wrong values when calculating perimeter and area

    Show us the main class
  4. Replies
    9
    Views
    134

    Re: Why isn't my code working?

    Look at your code and tell me what you think the value of c is at this point?


    if(c == 1){
    symbolBeingUsed = player1Symbol;
    }
    else{
    symbolBeingUsed =...
  5. Replies
    9
    Views
    134

    Re: Why isn't my code working?

    Probably because you are comparing the variable c and yet you are not initializing it anywhere. therefore your else statement will always be executed because how can c==1 if you never change the...
  6. Replies
    9
    Views
    134

    Re: Why isn't my code working?

    It would help if you explained your problem and post a complete compiling piece that shows us the problem.
  7. Re: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10 at Tutorial2.main(Tutorial2.java:40)

    This is a reference from Stackoverflow.


    In this case, i will be assigned to each element in the array - it is not an index into the array.

    What you want to do is:


    for(int i : myArray1)
    {
  8. Re: Not sure what is wrong, but I am sure it is basic.

    In java they tend not to use the word "pointer" due to the fact that you can not perform arithmetic on it, but essentially yes it can be USED like one(minus the arithmetic).
  9. Replies
    2
    Views
    164

    Re: Homework == Completely confused.

    Set up a rough draft on paper of the classes/attributes that you will use in order to start creating the program.
  10. Re: Not sure what is wrong, but I am sure it is basic.

    Yes, notice how you don't even allocate any memory to C, so how could it be a new Matrix.

    It would look like Matrix C = new Matrix(); //this actually creates a new matrix with it's own reference....
  11. Re: Not sure what is wrong, but I am sure it is basic.

    This all boils down to Objects and primitive data types.

    Primitive local data types are allocated on the stack and the address can not change. Objects are "normally" allocated on the Heap and the...
  12. Re: Not sure what is wrong, but I am sure it is basic.

    Look at your swap rows method. You are creating a matrix inside called C, you then set the reference to be of matrix A (essentially meaning A and C are the same matrix now). Then you make your...
  13. Replies
    7
    Views
    180

    Re: Array and Function Help!

    I would suggest using "num" as your while loop condition. Run while(num!=6)
  14. Replies
    7
    Views
    180

    Re: Array and Function Help!

    Break down your problem into simple steps and write them out.

    Right now that piece of code makes a randomely sized array of Strings. Then concatanates two random "codes" and stores it in the array...
  15. Replies
    7
    Views
    180

    Re: Array and Function Help!

    Take one step at a time, first off what are you trying to achieve with this line of code here


    int count = getRandomInt(1, 6);

    String[] itinerary = new String[count];
    ...
  16. Replies
    5
    Views
    119

    [SOLVED] Re: Why won't my code keep looping ??

    Format your code and put it in code tags so we can actually read it. Then it will be easier to push you in the right direction.
  17. Thread: need help

    by camel-man
    Replies
    4
    Views
    85

    Re: need help

    Is this the whole code? Post the full thing.
  18. Replies
    1
    Views
    65

    Re: Buffered Reader Statement not working

    Just before the if statement, Print out the values in nametext and password first to see if they actually equal eachother.
  19. Replies
    3
    Views
    84

    Re: Passing Variables between Classes

    Either make a variable in your Class2 class called Class1 runone = new Class1();

    or make the getX method static and call it like so
    y = Class1.getX() + 10

    Right now your runone variable is...
  20. Replies
    17
    Views
    269

    Re: Java Programming Exercise Help Needed

    What are you entering in exactly??
  21. Replies
    17
    Views
    269

    Re: Java Programming Exercise Help Needed

    ^^ yeah I didn't notice the error he posted up there.
  22. Replies
    17
    Views
    269

    Re: Java Programming Exercise Help Needed

    Look at the %6.2d, you can;t have a decimal in there when using an integer, if you want to make it a float/double (change the d to an f), then you can do that.
  23. Thread: java

    by camel-man
    Replies
    1
    Views
    83

    Re: java

    What have you tried so far?
  24. Replies
    6
    Views
    118

    Re: Help with a problem

    You should traverse the array and every time you find an element that is below zero keep a count for that, likewise for above zero. Those count variables can be used to create the length of the new...
  25. Replies
    2
    Views
    81

    Re: Conditional wrong?

    You seem to have the right cases down. Now you need to look into the reordering of your statements.

    For example look at when you enter in 12. You get:

    Your favorite number may be even or it...
Results 1 to 25 of 343
Page 1 of 14 1 2 3 4