# what's wrong in here!!!

• 10-31-2008, 02:25 AM
Annatar
what's wrong in here!!!
It compiles, but it does not run correctly :mad:

import java.io.*;

public class Bert
{
public static void main(String[] args) throws IOException
{
//Declaring Variables
String custName, inputPrice, inputDownPayment, inputTradeIn, inputMonths, inputAnnualInterest;
int price, downPayment, tradeIn, months, annualInterest;
double loanAmt,interest, payment;

//Get Input from User
System.out.print("What is the price of the car? ");
price = Integer.parseInt(inputPrice);
System.out.print("What is the downpayment? ");
downPayment = Integer.parseInt(inputDownPayment);
System.out.print("What is the trade-in value? ");
System.out.print("For how many months is the loan? ");
months = Integer.parseInt(inputMonths);
System.out.print("What is the decimal interest rate? ");
annualInterest = Integer.parseInt(inputAnnualInterest);

//Calculations
interest = annualInterest / 12;
payment= loanAmt / ((1/interest)-(1/(interest * Math.pow(1+interest, months))));

//Output
System.out.println("The monthly payment for " + custName + " is \$");
System.out.print(payment);
}
}
• 10-31-2008, 02:40 AM
Fubarable
Quote:

It compiles, but it does not run correctly
A great resource that has helped me and will probably help you is an article entitled How To Ask Questions The Smart Way. It will tell you how to formulate your questions so that the folks here will be better able to answer them.

For instance, it will go into detail on how the better the information you give about your problem, the better the chances of your getting a decent answer. Please elaborate further on "does not run correctly" and tell us as best you can what it's doing that it shouldn't be doing and what it's not doing that it should be doing. Also, what have you done to try to debug things? Have you placed System.out.println's in your code to test the state of different variables?

Good luck.
• 10-31-2008, 06:20 AM
Eranga
Quote:

Originally Posted by Annatar
It compiles, but it does not run correctly :mad:

First, you should ask your question much clearly. I think no one wants to run your code and find issues and fix them.

Second, do not post the same question again and again. I already found that you have post this question in another thread.
• 10-31-2008, 12:59 PM
presh4u
see whether the tags are closed correctly and the case sensitive
• 11-14-2008, 02:35 AM
Annatar
no sabes...
• 11-14-2008, 02:54 AM
emceenugget
Seriously, if you want help, you have to at least tell us what the output should be and what it is, and if you're nice enough, the portion of code it involves and why it seems to be going wrong.
• 11-14-2008, 03:01 AM
Fubarable
Creo que no vale la pena.
• 11-14-2008, 03:36 AM
CJSLMAN
Great Spanish...
Fubarable... either that's the title of a song or you speak Spanish... which?

CJSL
• 11-14-2008, 03:55 AM
Fubarable
I speak a little Spanish. It's my attempt at saying that I believe that this thread may not be worth the effort.