# Thread: what's wrong in here!!!

1. Member
Join Date
Oct 2008
Posts
3
Rep Power
0

## 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);
}
}

2. 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.

3. 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.

4. presh4u Guest
see whether the tags are closed correctly and the case sensitive

5. Member
Join Date
Oct 2008
Posts
3
Rep Power
0
no sabes...

6. Senior Member
Join Date
Sep 2008
Posts
564
Rep Power
12
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.

7. Creo que no vale la pena.

8. ## Great Spanish...

Fubarable... either that's the title of a song or you speak Spanish... which?

CJSL

9. I speak a little Spanish. It's my attempt at saying that I believe that this thread may not be worth the effort.

#### Posting Permissions

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