-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSaving_Account.java
43 lines (37 loc) · 1.09 KB
/
Saving_Account.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.util.Scanner;
public class Saving_Account
{
double P;
double R;
double Intrest;
double T;
double W=0;
double F;
Scanner Input = new Scanner(System.in);
public Saving_Account(double Principle, double rate, double CI, double Time, double Wallet) // Wallet is for personal money
{
P = Principle;
R = rate;
Intrest = CI;
Time = T;
W=Wallet;
}
public static void Main(String [] args)
{
}
public double Intrest(double Principle, double rate, double CI, double Time)//this is for the compound intrest formula.
{ // CI is amount of times per year your intrest compounds.
// And Time is the variable for how many years have passed in percentange
double FV = Math.pow(Principle*(1 + rate/CI), Time * CI); //FV = future values in the formula P(r + n/r)
System.out.println("" + FV);
return F = FV;
}
public double Deposit(double D)
{
return P += D;
}
public double Withdrawl(double WD)
{
return P -= Math.min(WD,W);
}
}