Hi, I'm taking a beginning programming class for Java and can't figure out what errors I made in my first program. This is supposed to be a very simple program and I know I probably look stupid getting confused on it, so please don't bother making fun of me.
import java.util.*; public class proj1 { public static void main(String[] args) { double monthlyPayment, annualInterest, outstandingBalance, accountBalance, paidInterest, paidPrincipal; annualInterestRate = .0625; paidInterest = (annualInterest / 12) * outstandingBalance; paidPrincipal = monthlyPayment - paidInterest; accountBalance = outstandingBalance - paidPrincipal; System.out.println("Enter this month's payment:"); Scanner keyboard = new Scanner(System.in); monthlyPayment = keyboard.nextDouble(); System.out.println("Enter the outstanding balance of the account:"); Scanner keyboard = new Scanner(System.in); outstandingBalance = keyboard.nextDouble(); System.out.println("Here is a breakdown of the payment:"); System.out.println("Interest paid-" paidInterest); System.out.println("Amount applied to principal" paidPrincipal); System.out.println("After the payment, the account balance is:" accountBalance); } }
when I tried compiling, this is what I got:
javac proj1.java
proj1.java:26: unclosed string literal
System.out.println("Here is a breakdown of the
^
proj1.java:26: ';' expected
System.out.println("Here is a breakdown of the
^
proj1.java:27: illegal start of expression
payment:");
^
proj1.java:27: unclosed string literal
payment:");
^
proj1.java:28: ')' expected
System.out.println("Interest paid-" paidInterest);
^
proj1.java:28: illegal start of expression
System.out.println("Interest paid-" paidInterest);
^
proj1.java:29: ')' expected
System.out.println("Amount applied to principal"
^
proj1.java:30: illegal start of expression
paidPrincipal);
^
proj1.java:31: unclosed string literal
System.out.println("After the payment, the account
^
proj1.java:31: ';' expected
System.out.println("After the payment, the account
^
proj1.java:32: unclosed string literal
balance is:" accountBalance);
^
11 errors