Results 1 to 4 of 4
  1. #1
    lala is offline Member
    Join Date
    Oct 2010
    Posts
    80
    Rep Power
    0

    Default Line:38: ';' expected

    Hi.
    I have checked this statement so many times. Can someone tell me what I'm missing?
    MonthlyPmts.java:38: ';' expected
    outputStr = "The number of months to payoff loan are : " + MostoRepay); ^
    The caret is under the closingn parenthesis.


    Java Code:
    import java.util.*;
    import javax.swing.JOptionPane;
    	 
    public class MonthlyPmts {
    static Scanner console = new Scanner(System.in);
    public static void main(String[] args){
    									
    	/* Declaring the variables that will be used in the problem */
    		String inputStr;
    		String outputStr;
    		int NoMos;
    		double MostoRepay;
    		double IntRateYr;
    		double loanAmt; 
    		double intRateMon;
    		double monPmt;
    /* Input Dialog boxes          */
     inputStr = JOptionPane.showInputDialog
    ("Enter the loan amount: ");
    loanAmt = Double.parseDouble(inputStr);	
    
    inputStr = JOptionPane.showInputDialog
     ("Enter the yearly interest rate: ");
    IntRateYr = Double.parseDouble(inputStr);
    	
    inputStr = JOptionPane.showInputDialog
     ("Enter the number of months : ");
    NoMos = Integer.parseInt(inputStr);	
    		
    	
    inputStr = JOptionPane.showInputDialog
     ("Enter the monthly payment: ");
    monPmt = Double.parseDouble(inputStr);
    
    MostoRepay = loanAmt / monPmt;
    
    outputStr = "The number of months to payoff loan are : " + MostoRepay);
    		
    JOptionPane.showMessageDialog(null,outputStr,
    		"Months Remaing to Payoff Loan",
    		JOptionPane.INFORMATION_MESSAGE);
                    }
    	}

  2. #2
    Muskar is offline Member
    Join Date
    Nov 2010
    Posts
    73
    Rep Power
    0

    Default

    Quote Originally Posted by lala View Post
    Hi.
    I have checked this statement so many times. Can someone tell me what I'm missing?
    MonthlyPmts.java:38: ';' expected
    outputStr = "The number of months to payoff loan are : " + MostoRepay); ^
    The caret is under the closingn parenthesis.


    Java Code:
    outputStr = "The number of months to payoff loan are : " + MostoRepay[COLOR="Red"][B])[/B][/COLOR];
    Delete that parenthesis.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

  4. #4
    lala is offline Member
    Join Date
    Oct 2010
    Posts
    80
    Rep Power
    0

    Default Line:38: ';' expected (SOLVED)

    Muskar, Fubarable many, many, many thanks.
    lala

Similar Threads

  1. tracing java application line by line using netbeans
    By chandrasekhar123 in forum NetBeans
    Replies: 1
    Last Post: 08-03-2010, 02:46 PM
  2. Replies: 2
    Last Post: 07-02-2010, 02:20 PM
  3. Replies: 4
    Last Post: 09-10-2009, 10:18 AM
  4. Replies: 9
    Last Post: 04-07-2009, 03:51 AM
  5. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 12:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •