Question: Help me rewriting this java. import java.util.Scanner; public class Main { public static void interest() { float p, r, t; Scanner s = new Scanner(System.in);
Help me rewriting this java.
import java.util.Scanner; public class Main { public static void interest() { float p, r, t; Scanner s = new Scanner(System.in); System.out.print("Enter the Principal : "); p = s.nextFloat(); System.out.print("Enter the Rate of interest : "); r = s.nextFloat(); System.out.print("Enter the Time period : "); t = s.nextFloat(); float si; si = (r * t * p) / 100; System.out.print("The Simple Interest is : " + si); } public static void main(String args[]) { interest(); } } /*output: "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.2\jbr\bin\java.exe" ... Enter the Principal : 20202 Enter the Rate of interest : 2.5 Enter the Time period : 3 The Simple Interest is : 1515.15 Process finished with exit code 0 */ Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
