User Profile

Collapse

Profile Sidebar

Collapse
ILtech
ILtech
Last Activity: Oct 20 '08, 09:59 PM
Joined: Oct 3 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ILtech
    replied to missing return statement
    in Java
    Right, that worked.

    Thank you very much. :]
    See more | Go to post

    Leave a comment:


  • ILtech
    started a topic missing return statement
    in Java

    missing return statement

    So this is my code. I get the error missing return statement, but I don't see where. Any suggestions would be greatly appreciated.

    (I realize there are probably some other issues in this code as well, but for now, I'm just focused on this one since it's currently preventing me from realizing the others.)

    Code:
    public boolean addHouse ( House a ) {
    		boolean done = false;
    		for (int i = 0; i < collection.length;
    ...
    See more | Go to post

  • ILtech
    replied to vectors and arrays
    in Java
    Thank you very much. I've got it all working now. :]
    See more | Go to post

    Leave a comment:


  • ILtech
    replied to vectors and arrays
    in Java
    Uhm...kay?

    The thing that's throwing me off is that my class hasn't said a word about vectors so I don't really know how to work with them.

    If I wanted to make an array out of the vector in the dotProduct, how would I do that?

    Something like...

    Code:
    double [] bArray = new double[b.size()] //the b.size() gives me an error...and i've imported java.util.* so what do i do here?
    ...
    See more | Go to post

    Leave a comment:


  • ILtech
    started a topic vectors and arrays
    in Java

    vectors and arrays

    "3. (5 points) Write a method for a class that uses an array

    For the Vector class given below, write a method that computes the dot product of the Vector "this" object with the Vector object passed as an argument, "b". The dot-product is the sum of the products of the corresponding elements of the vectors. The Vectors must be the same length for the dot-product to be defined. For example, if a = {1,2,3,4}...
    See more | Go to post
    Last edited by Nepomuk; Oct 15 '08, 09:13 PM. Reason: Added [CODE] tags

  • ILtech
    started a topic help with generating random numbers between -1 and 1
    in Java

    help with generating random numbers between -1 and 1

    Math.random() returns a number in the interval [0, 1), right?

    So, if I need to change the interval to (-1, 1), would I use do this...

    xCoord = Math.random() * 2 - 1;

    to change the range to be 2 (so it'd be [0, 2) then subtract one to shift it to (-1, 1)?
    See more | Go to post
No activity results to display
Show More
Working...