# Search:

Type: Posts; User: DarkestLord

Page 1 of 2 1

1. ## Thread: Boolean Method Problem

by DarkestLord
Replies
13
Views
140

### 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...
2. ## Thread: Boolean Method Problem

by DarkestLord
Replies
13
Views
140

### 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...
...
3. ## Thread: Boolean Method Problem

by DarkestLord
Replies
13
Views
140

### 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...
4. ## Thread: Boolean Method Problem

by DarkestLord
Replies
13
Views
140

### 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...
5. ## Thread: Boolean Method Problem

by DarkestLord
Replies
13
Views
140

### Re: Boolean Method Problem

Could you give me an example? I'm still learning things like this.
6. ## Thread: Boolean Method Problem

by DarkestLord
Replies
13
Views
140

### 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...
7. ## Thread: Weapons Test fails under certain conditions

by DarkestLord
Replies
5
Views
177

### 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?
8. ## Thread: Weapons Test fails under certain conditions

by DarkestLord
Replies
5
Views
177

### 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...

by DarkestLord
Replies
6
Views
103

### 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...

by DarkestLord
Replies
6
Views
103

### 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()...

by DarkestLord
Replies
6
Views
103

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

by DarkestLord
Replies
1
Views
13

Wrong forum, sorry. ^^;
13. ## Thread: How to keep track of %

by DarkestLord
Replies
1
Views
17

### 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.
14. ## Thread: Not getting the right outputs.

by DarkestLord
Replies
4
Views
15

### 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...
15. ## Thread: Not getting the right outputs.

by DarkestLord
Replies
4
Views
15

### 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.
...
16. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### Re: Code won't let me remove integer.

"java.lang.NullPointerException
null"

Is all it gave me. Also, what's a stacktrace?
17. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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;...
18. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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.
19. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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...
20. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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.
21. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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.
22. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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...
23. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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.
24. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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...
25. ## Thread: Code won't let me remove integer.

by DarkestLord
Replies
33
Views
33

### 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...
Results 1 to 25 of 34
Page 1 of 2 1