Population development
With a combined population of 145 million in the 2015 census (including Madura's 3.7 million),[37] which is estimated for 2014 at 143.1 million (including 3.7 million for Madura), Java is the most populous island in the world and is home to 57% of Indonesia's population. At over 1,100 people per km² in 2014, it is also one of the most densely populated parts of the world, on par with Bangladesh. Every region of the island has numerous volcanoes, with the people left to share the remaining flatter land. Because of this, many coasts are heavily populated and cities ring around the valleys surrounding volcanic peaks.
The population growth rate more than doubled in economically depressed Central Java in the latest 2010–2015 period vs 2000–2010, indicative of migration or other issues; there were significant volcanic eruptions during the earlier period. Approximately 45% of the population of Indonesia is ethnically Javanese,[38] while Sundanese make a large portion of Java's population as well.
The western third of the island (West Java, Banten, and DKI Jakarta) has an even higher population density, of nearly 1,500 per square kilometer and accounts for the lion's share of the population growth of Java. It is home to three metropolitan areas, Greater Jakarta (with outlying areas of Greater Serang and Greater Sukabumi), Greater Bandung, and Greater Cirebon.
Word game
Introduction
In word game, the computer program randomly picks up a secret word from a database of words and then shuffles it. The shuffled word is presented to the user and he is asked to guess the original word. The program ends when the user correctly guesses the word. The program also prints the number guesses made by the user for finding the correct answer.
The following Java program implements the word game. This program demonstrates a number of important language features such as getting user input, conditional checks, loops and string operations. It also demonstrates how a random word is picked up using the ThreadLocalRandom class, how a word is shuffled using array operations and how Scanner class can be used for user input.
Model
The most important part of this application is in the Game class, which includes the following functionality:
Generate a new solution;
Generate a new game from a solution;
Keep track of user input;
Check user input against generated solution;
Keep track of selected number;
Keep track of help is on or off.
Because the Game class extends Observable, it can and does notify observers when certain changes have been performed. This particular application contains two observers, ButtonPanel and WORDGamePanel. When the Gameclass executes setChanged() followed by notifyObservers(...), the observers will execute theirupdate(...) method.
Besides the Game class, the model consists of an enumeration called UpdateAction which will tell observers what kind of update has taken place.
Do'stlaringiz bilan baham: |