javacity
- import java.util.Scanner;
- public class JavaCity
- {
- private String JavaCity;
- JavaCity = Name ;}
- return JavaCity;}
- public void displayMessage(){
- }
- private int Round=1;
- private int Population=0;
- private int Culture=0;
- private int Food=0;
- private int Productivity=0;
- private int Wealth=0;
- private int choice;
- public void printStat(){
- do {
- System.out.printf("Round %d,[Population: %d,Culture: %d,Food: %d,Productivity: %d,Wealth: %d]\n",Round,Population,Culture,Food,Productivity,Wealth);
- System.out.printf("Please select:\n1.Add Professional\n2.Add Farmer\n3.Add Worker\n4.Add Businessman\n5.Leave the city");
- Round += 1;
- choice = gh.nextInt();//public void askForInput()
- if (choice == 1){
- Population += 1000;
- Culture += 1;
- Food -= 1;
- Productivity -= 1;
- System.out.print("Message: adding 1000 Professional to the city!\n");//public void addProfessional()
- }
- else if (choice == 2){
- Population += 1000;
- Food += 1;
- }// public void addFarmer()
- else if (choice == 3){
- Population += 1000;
- Food -= 1;
- Productivity += 1;
- }//public void addWorker()
- else if (choice == 4){
- Population += 1000;
- Food -= 2;
- Productivity += 1;
- Wealth += 1;
- }
- else if (choice == 5){
- else if(choice >= 6){
- }while((choice != 5 )&&(choice <=5));
- }
- JavaCity nj = new JavaCity();
- nj.displayMessage();
- nj.printStat();
- }
- }