using UnityEngine;
using System.Collections;
public class ExBank3 : MonoBehaviour {
// Use this for initialization
void Start () {
int deposit = 1000000000;
int year = 10;
int total = GetDeposit1(deposit, 10, 5);
print ("Deposit =" + deposit + ", Total=" + total + ", Year = " + year);
}
int GetDeposit1(int deposit, int year, int percent) {
int total = deposit;
for(int i = 0; i < year; i++){
total = total + deposit * percent / 100;
print (total);
}
return total;
}
// Update is called once per frame
void Update () {
}
}
'Computer Language > 유니티' 카테고리의 다른 글
zzz (0) | 2014.04.11 |
---|---|
복리 (0) | 2014.04.08 |
입출금 (0) | 2014.04.08 |
성적 (0) | 2014.04.08 |
배열의 값을 비교(함수) 2가지 방법 (0) | 2014.04.08 |