Find the error
import java.io.*;
import java.util.*;
class compound
{
static Scanner sc=new Scanner(System.in);
double pant,rate;
int time;
compound(double p,double r,int t)
{
pant=p;
rate=r;
time=t;
}
double FindIntrest()
{
double CI=0.0d;//local variable
CI=pant+Math.pow((1 + rate / 100), time);
return CI;
}
void PrintData()
{
System.out.println("Principal amount="+pant);
System.out.println("Rate="+rate);
System.out.println("Time="+time);
}
public static void main(String args[])
{
double p1,r1; int t1;
System.out.println("Enter a number");
p1=sc.nextDouble();
r1=sc.nextDouble();
t1=sc.nextInt();
compound sc=new compound(p1,r1,t1);
sc.PrintData();
}
}
Answers
Answered by
0
Answer:
Call the methods
sc. FindInterest
Similar questions