Author Message
jealzylu29

Joined: 09 Nov 2010
Posts: 1 Posted: Tue Nov 09, 2010 4:02 pm    Post subject: class, interface, or enum expected? I have received the error message class, interface, or enum expected. What does this mean and how can I fix it? this is the code: /*This program will display the mortgage payment amount from user input of the amount of the mortgage and the user's selection*/ public void main(String[] args) { double principal = 200000; //Principal of note double mortgageTerm = 0; //Years of the loan (30, 15, and 7) double interestRate = 0; //Interest of the loans (5.75%, 5.5% and 5.35% APR) double monthlyRate = 0; //Monthly interest paid (0.48, 0.45, and 0.45) double monthlyPayment = 0; //Monthly payment double totalMonths = 0; //Declares month (360, 180, 84 months) double multiplier=0; //Declares placeholder /* Calculated variables for the mortgage calculations (monthly rate and term)*/ totalMonths = mortgageTerm * - 12; multiplier = 1 + monthlyRate; multiplier = Math.pow(multiplier, totalMonths); multiplier = 1 - multiplier; /* Calculate the payment amount*/ double []loanUpdate = {7, 5.25F, 15, 5.5F, 30, 5.75F}; //This will give the monthly payment of the loan /* Print the result*/ System.out.println("Payment = %.2f"); //This will print a hard copy of the statement "Payment" System.out.println("Term of Note: years"); System.out.println("The principal is:200000"); System.out.println("Interest Amount: 0"); System.out.println("Interest Rate: 0"); System.out.println("Monthly Payment: 0"); System.out.println("Monthly Interest= 0");    Jesus

Joined: 02 Jan 2011
Posts: 1 Posted: Sun Jan 02, 2011 5:13 am    Post subject: Trying to help // Try this see if it works. public class Tester { public static void main(String[] args) { double principal = 200000; //Principal of note double mortgageTerm = 0; //Years of the loan (30, 15, and 7) double interestRate = 0; //Interest of the loans (5.75%, 5.5% and 5.35% APR) double monthlyRate = 0; //Monthly interest paid (0.48, 0.45, and 0.45) double monthlyPayment = 0; //Monthly payment double totalMonths = 0; //Declares month (360, 180, 84 months) double multiplier=0; //Declares placeholder /* Calculated variables for the mortgage calculations (monthly rate and term)*/ totalMonths = mortgageTerm * - 12; multiplier = 1 + monthlyRate; multiplier = Math.pow(multiplier, totalMonths); multiplier = 1 - multiplier; /* Calculate the payment amount*/ double []loanUpdate = {7, 5.25F, 15, 5.5F, 30, 5.75F}; //This will give the monthly payment of the loan /* Print the result*/ System.out.println("Payment = %.2f"); //This will print a hard copy of the statement "Payment" System.out.println("Term of Note: years"); System.out.println("The principal is:200000"); System.out.println("Interest Amount: 0"); System.out.println("Interest Rate: 0"); System.out.println("Monthly Payment: 0"); System.out.println("Monthly Interest= 0"); } }   Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1