Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

class, interface, or enum expected?

 
Post new topic   Reply to topic    Community Forum Index -> Java
View previous topic :: View next topic  
Author Message
jealzylu29



Joined: 09 Nov 2010
Posts: 1

PostPosted: Tue Nov 09, 2010 4:02 pm    Post subject: class, interface, or enum expected? Reply with quote

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");
Back to top
View user's profile Send private message AIM Address
Jesus



Joined: 02 Jan 2011
Posts: 1

PostPosted: Sun Jan 02, 2011 5:13 am    Post subject: Trying to help Reply with quote

// 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");
}
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB