0

Help 😭 me out why code is not excuting

26th Jul 2023, 3:41 PM
Ravi Chauhan
Ravi Chauhan - avatar
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...
26th Jul 2023, 3:44 PM
Riya
Riya - avatar
+ 3
Send your attempt first!
26th Jul 2023, 3:43 PM
Gulshan Mahawar
Gulshan Mahawar - avatar
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); }
27th Jul 2023, 1:59 AM
Ravi Chauhan
Ravi Chauhan - avatar
0
Now it is excuting actually I was putting extra brackets before Math.pow that's why it wasn't excuting
27th Jul 2023, 2:01 AM
Ravi Chauhan
Ravi Chauhan - avatar