Advertisements
write a program to evaluate the following investment equation make use of wrapper class v=p(1+r)rest to n
import java.util.*; class Investment { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter the value of p: "); double p=input.nextDouble(); System.out.print("Enter the value of r: "); double r=input.nextDouble(); System.out.print("Enter the value of n: "); double n=input.nextDouble(); double v1=1+r; double v2=Math.pow(v1,n); double v=p*v2; Double d=new Double(v); System.out.println(d); } }