To the Kingdom class (see Kingdom), add a method called buyLand.
Tutorial Details:
To the Kingdom class (see Kingdom), add a method called buyLand, which takes one parameter which is the amount of land to buy. This method will decrease the amount of stored grain by the amount needed to buy the land, and increase the amount of land.
A constant, SEED_REQUIRED_PER_ACRE, defines how much grain it takes to buy one acre of land.
Design decisions. You must decide exactly how to declare this method (public?, private?, static?, void?, double?, etc).
Rate Tutorial: http://www.roseindia.net/java/java-tips/oop/q-hammurabi/q-pr-hammurabi-buyLand.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Programming: Kingdom - Buy Land
View Tutorial: Programming: Kingdom - Buy Land
Related
Tutorials:
|