Search:

Type: Posts; User: DarkestLord

Page 1 of 2 1 2

Search: Search took 0.63 seconds.

  1. 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?
  2. 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...
  3. Replies
    6
    Views
    81

    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...
  4. Replies
    6
    Views
    81

    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()...
  5. Replies
    6
    Views
    81

    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
  6. Replies
    1
    Views
    13

    Trouble adding an object.

    Wrong forum, sorry. ^^;
  7. Replies
    1
    Views
    13

    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.
  8. Replies
    4
    Views
    10

    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...
  9. Replies
    4
    Views
    10

    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.
    ...
  10. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    "java.lang.NullPointerException
    null"

    Is all it gave me. Also, what's a stacktrace?
  11. Replies
    33
    Views
    25

    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;...
  12. Replies
    33
    Views
    25

    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.
  13. Replies
    33
    Views
    25

    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...
  14. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    That's what this is

    300.0
    100.0
    300.0
    100.0

    These are the only values I get from removeSilver();

    300.0 is the silver I tried to remove and 100.0 is the GP I had before and after.
  15. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    300.0
    100.0
    300.0
    100.0

    The 300.0 is the silver I tried to subtract and the 100.0 is the GP that was already there.
  16. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    I tried doing the Pursetest again. I added 100 gold and nothing else.

    "Your purse now has 100.0 gold."

    Then I only subtracted Silver. I subtracted 300 pieces and got this

    "300.0
    100.0...
  17. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    Edited the post. Now I can add it at the end, but I have no clue how I can access it. It only lets me visit the main method.
  18. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    Compiler won't let me put

    System.out.println(SILVER_VALUE);
    System.out.println(silver);

    at the end of the statement. It says they are both unreachable for some reason. It allows me to put it...
  19. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    Silver and Copper. When I add them (100 gold+200 silver and 4000 copper=160 gold) it works fine. But when I subtract them (100 gold-200 silver and 4000=100 gold) it acts like nothing happened. I...
  20. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    Well like I said, I changed the values and added .0 at the end. Now they show up as .1 and .01 on printlin() like they should. But when I try to subtract silver or copper from the total GP, nothing...
  21. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    Ahhh...well now the values are coming up correctly as

    1.0
    0.1
    0.01
    10.0

    I changed the values to 1/10.0 and 1/100.0 respectively.
    But I'm still dealing with the issue in which I can add...
  22. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    OK I editted my post. The code now has the println and at the bottom, I show the values I get. I set them to 1/10 and 1/100 respectively, but I only get 0 for some reason...
  23. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    Nowhere yet. Right now, they are supposed to convert into GP. Gold is 1 GP, silver is 1/10 of a GP, copper is 1/100 of a GP, and platinum is 10 GP. When I add them, everything works out fine and they...
  24. Replies
    33
    Views
    25

    Re: Code won't let me remove integer.

    What do you mean? Sorry, I'm new. ^^;
  25. Replies
    33
    Views
    25

    Code won't let me remove integer.

    EDIT: New issue. 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...
Results 1 to 25 of 28
Page 1 of 2 1 2