// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.math.BigDecimal;

public class M3 {
	public static void main(String[] args) {
		BigDecimal loanamt = new BigDecimal("100001.00");
		BigDecimal repayment = new BigDecimal("0.00");
		for(int i = 0; i < 100; i++) {
			repayment = repayment.add(new BigDecimal("1000.01"));
		}
		System.out.printf("You borrowed %.2f\n", loanamt);
		System.out.printf("You repaid %.2f\n", repayment);
		if(repayment.compareTo(loanamt) < 0) {
			System.out.println("You still owe " + (loanamt.subtract(repayment)));
		} else if(repayment.compareTo(loanamt) > 0) {
			System.out.println("You will get a refund of " + (repayment.subtract(loanamt)));
		} else {
			System.out.println("All good");
		}
	}
}
