You will make a single-player, round-based game called "Village152" using Java. This game will be played from a command terminal.
Story description and rules:
In this virtual village, there are three different types of people: workers, farmers, and soldiers. The roles of these three people are as follows:
Workers: making products.
Farmers: producing food thereby increasing the population in the kingdom.
Soldiers: fighting against enemy.
At Day-0, you have 30 villagers, 50 units of products, 50 units of food. You can set up the roles of different villagers, to be workers, farmers, or soldiers.
At any time, one worker can make 1 unit of products per day. Consuming 4 units of products will train a soldier (as if a weapon is equipped on the solider).
One farmer can produce 2-3 units of food per day. If such a day is a sunny day, 3 units of food will be produced by a farmer. In case of a non-sunny day (e.g. rainy day), 2 units will be produced by a farmer. However, all villagers, regardless of types, will consume food. A farmer will consume 1 unit of food, whereas a worker or a soldier will consume 2 units every day. If you have spare food, you can add 1 villager by consuming 5 units of food.
One soldier can fight 1 enemy at a given day when there is an enemy evasion. Consequently, about 30%-50% of the soldiers may die as a result of a battle. If your soldiers outnumber the enemies, no worker or farmer will die. If the enemies outnumber your soldiers at a particular day when they evade your village, all soldiers will die plus a 70%-90% decrease of the population to your workers and farmers.
The game will start from Day-1. Before each day, you will have the opportunity to reassign the roles of villagers. Conversions between workers and farmers, or from soldiers to workers/farmers cost no money(products). However, as previously stated, any conversion from a worker or a farmer to a soldier will cost 4 units of products.
Whether such a day is a sunny day or a non-sunny day is "the act of god", which is randomly decided by the computer program. Whether such a day is a peaceful day or war day is unpredictable, too. Furthermore, how many enemies will evade your village in a particular day can vary as well.
As you see, the player has to wisely determine how many workers, farmers, and soldiers are distributed before the start of each day, plus some good luck.
Winning condition(s):
You can decide whatever the winning condition is. For example, you can set the goal to be "reaching population of 100" or "having accumulated 1000 units of food before Day-100" or "having trained 60 soldiers", etc.
Losing condition(s):
Food cannot be exhausted by the end of any day or you will lose the game. The population of villagers cannot be below a certain number (e.g. 10) by the end of any day. In addition, you can decide something else as the losing condition to end the game.
You will have a lot of freedom to extend the game and modify some parameters initially set by the story description, because this is your game to play -- you are welcome to make it more interesting. For the programming part, though you have the freedom to determine the exact code structures (e.g. how many classes you create and what they do), there are several technical aspects to check:
(1) Creation of multiple classes, such as Villagers, Resources (food and products), Weather, Day, etc. You may use inheritance in your program structure.
(2) Handling of user-driven events, such as inputting numbers for allocating and adjusting roles of villagers.
(3) Correct computations of consuming and producing villagers and resources.
(4) Random number generations and processing. These may include but are not limited to weather conditions, casualty of solders, peace/war day shifts.
(5) Record keeping of important numbers after each day. Such data should include numbers of different resources, different types of villagers. You may consider to use arrays or other appropriate structures to store data.
(6) The ability of correctly handling exceptions during the gameplay. For example (but this is just one example, you should consider more!), the game should not allow the player to produce 10 more villagers if the number of food is currently below 50.