Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[]){
- Scanner bucky = new Scanner(System.in);
- double fnum, snum, answer;
- System.out.println("Enter first num: ");
- fnum = bucky.nextDouble();
- System.out.println("Enter Second num: ");
- snum = bucky.nextDouble();
- answer = fnum + snum;
- System.out.println(answer+" Added");
- answer = fnum - snum;
- System.out.println(answer+ " Subtracted");
- answer = fnum * snum;
- System.out.println(answer+ " Multiplied");
- answer = fnum / snum;
- System.out.println(answer+ " Divided");
- CompoundInterest();
- }
- public static double CompoundInterest() {
- System.out.println("Type the principal");
- double p = scan.nextDouble();
- System.out.println("Type the interest rate");
- double r = scan.nextDouble();
- System.out.println("Type how often the interest in compounded");
- double n = scan.nextDouble();
- System.out.println("Type the time");
- double t = scan.nextDouble();
- double part1 = (p * (1 + (r / n)));
- double part2 = (n * t);
- double A = Math.pow(part1, part2);
- return A;
- A = p*r*t/100
- System.out.print("the simple interest is :" + A);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement