Search:

Type: Posts; User: Wonderlandslost

Page 1 of 2 1 2

Search: Search took 0.50 seconds.

  1. Replies
    7
    Views
    762

    Re: I'm confused

    I solved the print portion of it, yes :)
    I am curious about abstract though. I'm using the abstract method ArrayDrawer for this program (Since my book showed using that for a similar example). ...
  2. Replies
    7
    Views
    762

    Re: I'm confused

    arraydrawer.ArrayDrawer is abstract; cannot be instantiated

    Surround with ...
    That is what the compiler I'm using is telling me as the error for;

    public static void main(String[] args)
    ...
  3. Replies
    7
    Views
    762

    Re: I'm confused

    The problem I'm trying to solve is creating an ArrayDrawer class that has the arrays square[] and triangle[] (as listed in code). I have to take those and add them into the first open position. I...
  4. Replies
    7
    Views
    762

    I'm confused

    I'm working on a program with a main class; ArrayDrawer and two subclasses; square and triangle. Here is what I've gotten so far;


    public abstract class ArrayDrawer
    {
    //Global Data
    ...
  5. [SOLVED] Re: I'm not sure what I need to do next.

    I'm still unsure. However, my instructor cancelled the project and assigned a new one in its stead. I will return to this project as soon as I can, just so I can understand it better, but as of...
  6. [SOLVED] Re: I'm not sure what I need to do next.

    I honestly don't know at this point. I'm really lost in the program. I went through the book and added in things from the example that was provided, but I'm not sure..




    public class Drawer...
  7. [SOLVED] Re: I'm not sure what I need to do next.

    I can't figure out what datatype myShape is. I've never declared an array without saying 'string' or 'int'...
    As for the datatype of z, it's a double.

    In this case, would my array be an int...
  8. [SOLVED] Re: I'm not sure what I need to do next.

    public double add(double z)
    {
    //Use the findFirstEmpty to locate the first null spot
    int x = findFirstEmpty();
    //Take the empty spot and put the item in it
    if...
  9. [SOLVED] How do I go from here?

    So my instructor assigned us to create a program that calculates the area and stores that, along with coordinates, in an array. This has to be done for both triangles and squares. He is having us...
  10. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    Okay, I reviewed the chapters and figured out the meaning. That means not equal to.
  11. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    I do not know that the != operator does. I do know that that will be true when there is an empty spot, or a null spot, in the array.

    I also ran the program, printing out what x was from the...
  12. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    So, I tried doing what you said, I had troubles with it, but i was looking at the code once more and it looks as if the findFirstEmpty is only returning -1.

    It'll go through the for loop...
  13. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    I was mistaken, thinking that names was something I could use there. I corrected that. I'm now testing in my main method;



    /*
    * Author: Rachel Moss
    * Class: CS 3100
    * Teacher: Dr....
  14. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    /*
    * Author: Rachel Moss
    * Class: CS 3100
    * Teacher: Dr. Silverman
    *
    * Compiles:
    * Works:
    */
    package schoolbus; //Check this portion 2/10/12
  15. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    Okay, now I'm having some troubles with the test method and my getOn method;


    public String sample(String name)
    {
    name = "Anna";
    names.getOn(name);
    return name;
    ...
  16. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    I've tested them. They all work so far. I'm just confused how to get the name in there to set it to null. I thought that using if x>= 0, then following that with names = null; would work. And...
  17. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    It was put into the array and then set out so that it could get more information. So, would this one need to return anything at all, since it is merely setting a portion to null once more?

    And...
  18. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    I'm not sure to the first question, I'm not sure how to go about doing that. As for why it returns a string, perhaps it doesn't. I've changed it slightly to have it return null, since I am changing...
  19. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    getOff is supposed to take the array and find a specific name, it then has to take that and set it back to null, which virtually represents the child getting off of the bus. I think that it is...
  20. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    In regards to the getOff function, since it is similar to getOn by way of what it's doing, only reverse, would it be possible to do something like this;


    public String getOff(String name)
    ...
  21. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    Okay, I'm not completely sure I'm following, but would it be the fact I have x != -1 instead of x == -1?
  22. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    Would it be something along the lines of this;


    int x =findFirstEmpty();
    //Take the empty seat and put the child in it
    if (x != -1)
    {
    //indicates...
  23. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    Since I returned the -1 value to indicate that it was a full array. I thought that by stating that the x value I pulled from findFirstEmpty was equal to -1 in the if statement, I could have the...
  24. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    So, I wouldn't need a return? Or would I need to return something else, like the original string name instead of the array string names?
    Something like;

    public String getOn(String name)
    ...
  25. Replies
    64
    Views
    1,814

    [SOLVED] Re: Stuck and can't get past it!

    Well, as far as I understand, the program requires us to push string names, such as anna, into the getOn method through the main method. Since I'm assuming that name is going to be the string that...
Results 1 to 25 of 43
Page 1 of 2 1 2