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...
Type: Posts; User: DarkestLord
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...
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.
...
It highlight "total" under the WeaponAttack and WeaponDamage methods and says "incompatible types".
Yeah, I compiled and apparently it's incompatible. But that's the problem. I first need to figure out how to make it compatible.
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.
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...
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...
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...
...
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...
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...
Uhhh how would I go about this? ^^;
Could you give me an example? I'm still learning things like this.
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...
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?
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...
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...
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()...
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
Wrong forum, sorry. ^^;
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.
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...
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.
...
"java.lang.NullPointerException
null"
Is all it gave me. Also, what's a stacktrace?
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;...
I fixed the silver/copper problem, but now I have a new issue. I editted the code and original post.
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...