• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Gunner class implementation

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?








 
Jann Kowalski
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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'.
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Before you know it you'll be done.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!