Handson Exam
Soldiers

Write a Soldier class (Soldier.java) for the following program . A Soldier object represents a soldier with a gun. He has some money (1000 pesos) to buy ammunition (also called bullets or rounds) and a pistol with a bullet capacity of 6. The soldier will also have supply of bullets. (bullets that are not in the gun). Methods to be supported are buyAmmo, reload, and fire. At any point, we would like to be able to find out how much money is left, how many bullets are left in the gun, the level of bullet supply, and the total number of bullets fired. For the sample program, this output should result.

Use BlueJ so that you could test your Soldier objects visually. Include the SoldierSimulation program in the BlueJ project so that you can test and compare against the expected output (Create a SoldierSimulation class, and then cut and paste the code from the link). You should be able to infer which methods need to be present in the Soldier class from the SoldierSimulation program. Nevertheless, the methods are:

You do not have to worry about negative-valued parameters. Zip your BlueJ project (name it HO1xxxxxx.zip where xxxxxx is your id number) and submit through moodle