Here is part of the code:
Army Class
public static void main(String[] args) throws IOException {
Army superArmy = new Army();
Scanner fileScan = new Scanner(new File("regiments.txt"));
while (fileScan.hasNext()) // while not eof
{
int regimentNumber = fileScan.nextInt();
String name = fileScan.next();
int men = 1000;
Regiment next = new Regiment(regimentNumber, name, men);
superArmy.AddRegiment(next);
}
superArmy.PrintList();
}
public void PrintList() {
for (int i = 0; i < regiment.size(); i++) {
Regiment more = regiment.get(i);
System.out.println("Regiment Number: " + "[" + more.getRegimentNumber() + "]"
+ " Regiment Name: " + "[" + more.getName() + "]"
+ " Number Of Men: " + "[" + more.getNumberOfMen() + "]");
}
}
There is another class "Regiment" which has return values...but I don't think we have to update it(I think not sure). Also the code is a lot bigger but these are the specific parts I'm having trouble on. How would I update the men value so it decreases by lets say 50 for each regiment(1000, 950, 900, 850, etc)