0
Help đ me out why code is not excuting
4 Answers
+ 6
Ravi Chauhan ,
To help you have to show your code...
otherwise how could we know why your code is not running??
And don't post the same question many times...
+ 3
Send your attempt first!
0
import java.util.*;
class checkamout
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
double p,amt = 0.0,t;
System.out.println("Enter your principal :");
p = sc.nextDouble();
System.out.println(" Enter time period : ");
t = sc.nextDouble();
if ( t <0.5)
{
amt = p *Math.pow((1+9.0/100.0) , t);
System.out.println(" Your amount is : " + amt);
}
else if (t>0.5 || t <=1)
{
amt = p * Math.pow((1+10.0/100.0) , t);
System.out.println(" Your amount is : " + amt);
}
else if(t >1 || t <= 3)
{
amt = p *Math.pow((1+11.0/100.0) , t);
System.out.println(" Your amount is : " + amt);
}
else if (t > 3)
{
amt = p * Math.pow((1+12.0/100.0) , t);
System.out.println(" Your amount is : " + amt);
}
0
Now it is excuting actually I was putting extra brackets before Math.pow that's why it wasn't excuting