Hey i'm having a hard time with this task(Code below):
I need to write class Gunner which extends abstract class GunnerA. The task of the class is to destroy the target using ShootingRules interface. Gunner class has to destroy the target using information "to close/ to far" and with the least number of shots possible.
Extra info: I can't modify GunnerA class, Gun and ShootingRules interface. Gunner class have to use no-argument constructor.
Can you give me any tips how to start ? some examples ?
Umm, and where exactly did i try to ask for a complete solution? I clearly asked for TIPS on how to start or some examples (not necessarily with the code i posted).
I just don't have an idea on how to start developing this code (however silly it may sound for others). Sorry if I made it look like I want a 'free homework'.
The usual answer to 'where to start' is on pencil and paper. Think about the requirements. The first thing to do is pick just one requirement. Then take that requirement and break it down in to small steps. This is where the pencil and paper come in - take those small steps and write them out on paper in the order you think they need to occur. Then take each step and (still on paper) and turn them into something that approximates code (pseudo code). Once you are sure you know how to get one task done in pseudo code, write the actual code in java and test it. Then fix it and test it again.
Then, when it works, take the next small step of the first requirements and do the same thing.