/*
Author: Aaron Hurt
Class: COMP 313, Intro to Java
Time: Saturday, 8 to 1
Assignment: Homework 3
Program description: Determine montly interest and fees
for a bank account given it's balance and type
*/

import java.text.*;

public class Homework3 {
	public static void main(String[] args) {
		//show a little info
		System.out.println("Checking and Saving account helper v0.1\n\n");
		//defind vars and get input
		double interest;
		String acctType = GetData.getString("Please enter an account type: Savings(S) or Checking(C)");
		double acctBal = GetData.getDouble("Please enter an account balance");
		DecimalFormat out = new DecimalFormat("\u00a4#,##0.00");
		if (acctType.equalsIgnoreCase("C")) {
			if (acctBal < 500) {
				interest = acctBal * 0.03;
				System.out.println("\n\nAccount Type: Checking\n\nFee: $6.00\nInterest: "+out.format(interest)+"\n\n");
			} else {
				interest = acctBal * 0.05;
				System.out.println("\n\nAccount Type: Checking\n\nFee: $3.00\nInterest: "+out.format(interest)+"\n\n");
			}
		} else if (acctType.equalsIgnoreCase("S")) {
			interest = acctBal * 0.06;
			System.out.println("\n\nAccount Type: Savings\n\nFee: $0.00\nInterest: "+out.format(interest)+"\n\n");
		} else {
			System.out.println("ERROR, Invalid account type entered.");
		}
	}  //end main
}  //end class Homework3
