Question: I NEED EXPERT HELP WITH JAVA CODE PLEASE!!! If you know the balance and the annual percentage interest rate, you can compute the interest on

I NEED EXPERT HELP WITH JAVA CODE PLEASE!!!

I NEED EXPERT HELP WITH JAVA CODE PLEASE!!! If you know thebalance and the annual percentage interest rate, you can compute the interest

If you know the balance and the annual percentage interest rate, you can compute the interest on the next monthly payment using the following formula: interest = balance X (annuallnterestRate / 1200) Write a program that reads the balance and the annual percentage interest rate and displays the interest for the next month in two versions: 1. Use dialog boxes to obtain input from the user and display output; 2. Use the console to obtain input from the user and display output. Be sure to provide clear prompts to the user, so that input is entered correctly. Sample Data: Balance = 100000 Annual Interest Rate = 4.625 Interest = 385.41 Language Java Run Debug Stop Share M Save {Beautify Main.java 1 import javx.swing.JOptionPane; 2. public class calculate Interest{ public static void main( E[] args) { String balanceString JOptionPane.showInputDialog("Enter the balance: "); String rateString = JOptionPane.showInputDialog("Enter interest rate(e.g., 3 for 3%):"); double balance = Double.parseDouble(balanceString); double rate = Double-parseDouble(rateString); double interest balance * (rate/1200); String output "The interest is:" + interest ; 14 JOptionPane.showMessageDialog(null, output); 15 } 16 } 17 import java.util.Scanner; 18 class interest{ 19 20 public static void main(String args[]){ 21 Scanner s = new Scanner(System.in); 22 System.out.print("Enter balance and interest rate e.g. 3 for 3%): "); 23 double b = s.nextDouble(); 24 double r s.nextDouble(); 25 double i (float)(b r/ 1200); 26 27 System.out.print("The interest is" + i); 28 } 29 } input Compilation failed due to following error(s). Main.java:17: error: class, interface, or enum expected import java.util.Scanner; 1 error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!