Search:

Type: Posts; User: DarkestLord

Page 1 of 2 1 2

Search: Search took 0.12 seconds.

  1. Replies
    11
    Views
    1,305

    Re: Need help creating an array method.

    Yeah, calling it twice would be the simple solution but...this is an assignment and it asks for me to make an array method that allows me to use as many weapons as the user wants. The test would just...
  2. Replies
    11
    Views
    1,305

    Re: Need help creating an array method.

    Sorry, I'm still pretty new at this. ^^; But...that's all it says. It just highlight "total" under those two and says "compatible types". I think it's because of the [] I added on those ints.
    ...
  3. Replies
    11
    Views
    1,305

    Re: Need help creating an array method.

    It highlight "total" under the WeaponAttack and WeaponDamage methods and says "incompatible types".
  4. Replies
    11
    Views
    1,305

    Re: Need help creating an array method.

    Yeah, I compiled and apparently it's incompatible. But that's the problem. I first need to figure out how to make it compatible.
  5. Replies
    11
    Views
    1,305

    Re: Need help creating an array method.

    Basically I'm supposed to get a random number between 1-20 but I need it for multiple weapons. One could get 5, another 13, and a third could get 17, etc.
  6. Replies
    11
    Views
    1,305

    Need help creating an array method.

    I need help creating an array method for my monster class. The monster is going to have multiple weapons and I need to figure out how to get attack and damage from all of them.


    /**
    * Write a...
  7. Replies
    13
    Views
    1,297

    Re: Boolean Method Problem

    Ahhh...but...what makes them new? They are called the same thing in each question? I tried removing "boolean" in front of the question variables, but the problem remains. Is it something else that...
  8. Replies
    13
    Views
    1,297

    Re: Boolean Method Problem

    OK, updated the detector and the test...

    Currently the program is still telling me the item is cursed no matter what though. I think the problem is in the test, but I'm not sure what it is...
    ...
  9. Replies
    13
    Views
    1,297

    Re: Boolean Method Problem

    OK, this IS the problem. It's connected to the input somehow. If I do true, true, true, true, true, the fifth "true" for "Summons Monsters" is always true, which means the item is always cursed. I...
  10. Replies
    13
    Views
    1,297

    Re: Boolean Method Problem

    Oh! I wasn't familiar with &&! Thanks! The program still isn't working, but this is very helpful!

    Hmmm...the only other thing I can think of is the way I coded the test. When I call the method, I...
  11. Replies
    13
    Views
    1,297

    Re: Boolean Method Problem

    Uhhh how would I go about this? ^^;



    Could you give me an example? I'm still learning things like this.
  12. Replies
    13
    Views
    1,297

    Boolean Method Problem

    I'm writing a program called Curse Detector. The idea is that you answer 5 questions and this program tells you if an item is cursed.

    The item is cursed if:
    1) The item adds +6 or less to the...
  13. Re: Weapons Test fails under certain conditions

    Thank you for the truth table, but is there a way to make it bigger? I'm having trouble reading it. ^^; Also, what do the -1s mean?
  14. Weapons Test fails under certain conditions

    I'm making a Weapons Class and a Weapons Test.

    The Weapons Class gives me the damage power of each weapon (which changes each time) and the Weapons Test is supposed to show me the value and tell...
  15. Replies
    6
    Views
    1,082

    Re: Trouble adding an object.

    I see...I'm also trying to list equipment, add equipment, and remove equipment. The equipment class looks like this:


    public class Equipment
    {
    private String name;
    private int weight;
    public...
  16. Replies
    6
    Views
    1,082

    Re: Trouble adding an object.

    I see...but how would I put it in the backpack from the method? This is what I have so far:



    public class Backpack
    {
    private Canteen theCanteen;
    private Equipment[] theEquipment;
    Backpack()...
  17. Replies
    6
    Views
    1,082

    Trouble adding an object.

    I made two classes for my "Backpack". You may ignore these if you wish.


    /**
    * A storage space for items
    *
    * @author Erik
    * @version 1
    */
    public class Canteen
  18. Replies
    1
    Views
    744

    Trouble adding an object.

    Wrong forum, sorry. ^^;
  19. Replies
    1
    Views
    616

    How to keep track of %

    I'm trying to make a canteen class that holds water. It holds two quarts of water and two quarts is 100%.



    public double maxVolume;
    public int percentFull;

    Right now the Canteen is empty.
  20. Replies
    4
    Views
    722

    Re: Not getting the right outputs.

    I'm assuming you mean change the test, so as to understand what variables are being shown. I got this as my output

    Leather Speed: 0
    Chainmail Speed: 0
    Full Plate Speed: 0
    Leather arcane spell...
  21. Replies
    4
    Views
    722

    Not getting the right outputs.

    I'm making an armor class. I also made a test for it to ensure it works, but something seems to be wrong. I'm not getting the expect outputs when I ask it to give me a println of the variables.
    ...
  22. Replies
    33
    Views
    2,085

    Re: Code won't let me remove integer.

    "java.lang.NullPointerException
    null"

    Is all it gave me. Also, what's a stacktrace?
  23. Replies
    33
    Views
    2,085

    Re: Code won't let me remove integer.

    My program gives me an error when I try to "digUp" the purse. The error appears in the purse class.


    import java.io.*;
    public class Purse
    {
    //Fields
    public double gp;
    public double gold;...
  24. Replies
    33
    Views
    2,085

    Re: Code won't let me remove integer.

    I fixed the silver/copper problem, but now I have a new issue. I editted the code and original post.
  25. Replies
    33
    Views
    2,085

    Re: Code won't let me remove integer.

    After I get this working, I plan to keep track of individual amounts of currency. For example, you won't be able to remove 400 silver if you only have 10 silver. But this is something I haven't...
Results 1 to 25 of 40
Page 1 of 2 1 2