import java.io.*; import java.util.Scanner ; void class Amount::productcal(doubl
ID: 3614511 • Letter: I
Question
import java.io.*;import java.util.Scanner ;
void class Amount::productcal(double interest;int j)
{
double product=1;
for(int l=0;l<j;l++)
product = product *interest;
return product;
}
void futureValueByCIA(double amount,double interest)
{
for(int i=0;i<10;i++)
double product = 1;
System.out.println("The amount in the "+i+1+" is"+amount*produtcal(interest,i);
}
void futureValueByCIM(double amount,double interest)
{
int count = 1;
for(int i=0;i<10;i++)
for(int k=0;k<12;k++)
System.out.println("The amount in the "+k+1+" is"+amount*powercal(interest/12,count++));
}
void futureValueByCID(double amount,double interest)
{
int count = 1;
for(int i=0;i<10;i++)
for(int k=0;k<365;k++)
System.out.println("The amount in the "+k+1+" is"+amount*powercal(interest/365,count++));
}
class Amount{
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a amount : ");
double amount = scanner.nextDouble();
System.out.print("Enter interest: ");
double interest = scanner.nextDouble();
futureValueByCIA(amount,interest);
futureValueByCIM(amount,interest);
futureValueByCID(amount,interest);
}
}
Explanation / Answer
import java.io.*; import java.util.Scanner ; public class Amount{ public static double productcal(double interest, int j) { double product=1; for(int l=0;lRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.