// 펀드 시세를 변동시키는 메소드 public void randomForFund() { String code = null; Fund funds[] = wrap.getAllFunds(); for (int i = 0; i < funds.length; i++) { int current = funds[i].getCurrent(); float commision = funds[i].getCommision(); float daycommision = funds[i].getDayCommision(); int selected = (int) (Math.random() * 10); if (selected % 2 == 1) { current += selected; commision += selected; daycommision += selected; code = "Fund++"; } else { current -= selected; commision -= selected; daycommision -= selected; code = "Fund--"; } funds[i].setCurrent(current); funds[i].setCommision(commision); funds[i].setDayCommision(daycommision); } wrap.setAllFunds(funds); // 펀드 시세가 변동되었음을 통보하는 객체를 생성 notice = new Notice(code); }