All pastes #923823 Raw Edit

Stuff

public java v1 · immutable
#923823 ·published 2008-02-29 21:48 UTC
rendered paste body
import java.io.*;import java.util.ArrayList;import java.util.Iterator;import java.util.List;import java.util.Scanner;public class Score {		public static void main(String[] args) {				Scanner r = new Scanner(System.in);		List<Country> Nation  = new ArrayList<Country>();				System.out.println("do you want to create new nation? YES/NO ");		String n = r.nextLine();		if (n.equals("YES")) {						Country n1 = new Country();			OmaTiedostoKirjoittaja f = new OmaTiedostoKirjoittaja("teppo.txt");						f.tulostaRivi("score: " + n1.totalScoreCalc());			f.tulostaRivi("name: " + n1.nameCatch());			f.tulostaRivi("bid: " + n1.bidIn());			f.tulostaRivi("number of bankrubties: " + n1.bankrubtIn());			f.tulostaRivi("number of conditional vicories: " + n1.warCounter1());			f.tulostaRivi("number of unconditional victories: "+ n1.warCounter2());			f.tulostaRivi("number of crushing victories: " + n1.warCounter3());			f.tulostaRivi("number of conditional defeats: " + n1.warCounter4());			f.tulostaRivi("number of unconditional defeats: " + n1.warCounter5());			f.tulostaRivi("number of epic failures: " + n1.warCounter6());			f.tulostaRivi("number of treaties broken: " + n1.betrayer());			f.tulostaRivi("number of months own capital occupied by foreigners: " + 					n1.occupier1());			f.tulostaRivi("number of months enemy capital occupied: "+  n1.occupier2());			f.tulostaRivi("number of times expeditionary armies sent to losing side: " +					n1.expCounter());							System.out.println(n1.finalScore());			f.tulostaRivi("total score: " + n1.finalScore());			Nation.add(n1);			f.sulje();		}				System.out.println("1st nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n2 = new Country();						n2.totalScoreCalc();			n2.nameCatch();			n2.bidIn();			n2.bankrubtIn();			n2.warCounter1();			n2.warCounter2();			n2.warCounter3();			n2.warCounter4();			n2.warCounter5();			n2.warCounter6();			n2.betrayer();			n2.occupier1();			n2.occupier2();			n2.expCounter();							System.out.println(n2.finalScore());			Nation.add(n2);		}				System.out.println("2nd nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n3 = new Country();						n3.totalScoreCalc();			n3.nameCatch();			n3.bidIn();			n3.bankrubtIn();			n3.warCounter1();			n3.warCounter2();			n3.warCounter3();			n3.warCounter4();			n3.warCounter5();			n3.warCounter6();			n3.betrayer();			n3.occupier1();			n3.occupier2();			n3.expCounter();							System.out.println(n3.finalScore());			Nation.add(n3);		}				System.out.println("3rd nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n4 = new Country();						n4.totalScoreCalc();			n4.nameCatch();			n4.bidIn();			n4.bankrubtIn();			n4.warCounter1();			n4.warCounter2();			n4.warCounter3();			n4.warCounter4();			n4.warCounter5();			n4.warCounter6();			n4.betrayer();			n4.occupier1();			n4.occupier2();			n4.expCounter();							System.out.println(n4.finalScore());			Nation.add(n4);		}				System.out.println("4th nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n5 = new Country();						n5.totalScoreCalc();			n5.nameCatch();			n5.bidIn();			n5.bankrubtIn();			n5.warCounter1();			n5.warCounter2();			n5.warCounter3();			n5.warCounter4();			n5.warCounter5();			n5.warCounter6();			n5.betrayer();			n5.occupier1();			n5.occupier2();			n5.expCounter();							System.out.println(n5.finalScore());			Nation.add(n5);		}				System.out.println("5th nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n6 = new Country();						n6.totalScoreCalc();			n6.nameCatch();			n6.bidIn();			n6.bankrubtIn();			n6.warCounter1();			n6.warCounter2();			n6.warCounter3();			n6.warCounter4();			n6.warCounter5();			n6.warCounter6();			n6.betrayer();			n6.occupier1();			n6.occupier2();			n6.expCounter();							System.out.println(n6.finalScore());			Nation.add(n6);		}				System.out.println("6th nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n7 = new Country();						n7.totalScoreCalc();			n7.nameCatch();			n7.bidIn();			n7.bankrubtIn();			n7.warCounter1();			n7.warCounter2();			n7.warCounter3();			n7.warCounter4();			n7.warCounter5();			n7.warCounter6();			n7.betrayer();			n7.occupier1();			n7.occupier2();			n7.expCounter();							System.out.println(n7.finalScore());			Nation.add(n7);		}				System.out.println("7th nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n8 = new Country();						n8.totalScoreCalc();			n8.nameCatch();			n8.bidIn();			n8.bankrubtIn();			n8.warCounter1();			n8.warCounter2();			n8.warCounter3();			n8.warCounter4();			n8.warCounter5();			n8.warCounter6();			n8.betrayer();			n8.occupier1();			n8.occupier2();			n8.expCounter();							System.out.println(n8.finalScore());			Nation.add(n8);		}				System.out.println("8th nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n9 = new Country();						n9.totalScoreCalc();			n9.nameCatch();			n9.bidIn();			n9.bankrubtIn();			n9.warCounter1();			n9.warCounter2();			n9.warCounter3();			n9.warCounter4();			n9.warCounter5();			n9.warCounter6();			n9.betrayer();			n9.occupier1();			n9.occupier2();			n9.expCounter();							System.out.println(n9.finalScore());			Nation.add(n9);		}				System.out.println("9th nation created. Do you want to create new nation? YES/NO ");		n = r.nextLine();		if (n.equals("YES")) {			Country n10 = new Country();						n10.totalScoreCalc();			n10.nameCatch();			n10.bidIn();			n10.bankrubtIn();			n10.warCounter1();			n10.warCounter2();			n10.warCounter3();			n10.warCounter4();			n10.warCounter5();			n10.warCounter6();			n10.betrayer();			n10.occupier1();			n10.occupier2();			n10.expCounter();							System.out.println(n10.finalScore());			Nation.add(n10);		}		Iterator<Country> it = Nation.iterator();				while(it.hasNext()) {			Country s = (Country) it.next();			System.out.println("Nation: "+s);		}					}}