I am not getting result as exoected , pls help me .....
Here is code : import java.util.Scanner; public class Main { public static void main(String[] args) { int P; float R; int T ; float SI; System.out.println("Enter Principal"); Scanner newScan = new Scanner(System.in); P= newScan.nextInt() ; System.out.println("Enter Rate"); R=newScan.nextFloat() ; System.out.println("Enter Time"); T= newScan.nextInt(); System.out.println("You Entered P : " + P ); System.out.println("You Entered R : " + R ); System.out.println("You Entered T : " + T ); System.out.println("Is this correct ? Press Y/N"); String UserInput = newScan.nextLine(); String Y = "Y"; String N = "N"; if(Y == UserInput) { System.out.println("Continuing"); SI = P * R * T / 100; System.out.println("The Result is " + SI); }else if (N == UserInput) { System.out.println("You Have chosen to quit"); System.out.println("Quiting.....");} else { System.out.println("You made a wrong choice");} } } . . . This is output Enter Principal 45 Enter Rate 4 Enter Time 3 You Entered P : 45 You Entered R : 4.0 You Entered T : 3 Is this correct ? Press Y/N You made a wrong choice Please Help me