Okay so basically I'm making a mortgage program and I'm supposed to ask the user if they would want to run the calculation again. It works for the most part, when i type in positive inputs, but when...
Type: Posts; User: MLIAKIRA
Okay so basically I'm making a mortgage program and I'm supposed to ask the user if they would want to run the calculation again. It works for the most part, when i type in positive inputs, but when...
I guess netbeans is broken then...I created a new file, renamed it, did everything I think I could and it's still not doing what you said you got...
--- Update ---
SMH. I guess the file was...
So this code works perfectly for you and it just seems to not want to work on netbeans?
it says javac is unrecognizable...should I just give up?
Nope can you show me how?
EDIT: but that doesn't help me with the code will it? also, I have to turn it in working on netbeans sooo....
yes.
If that code is impossible what's the code you used to get that answer?!
You just said that code could not create what I wanted and could you maybe screen shot it? Are you sure you didn't change it because this is exactly what I got after saving and reopening netbeans.
...
I know!! That's why I've been asking for help hahah
Hence "my goal"
All the equations and stuff work perfectly it's just the If-Then statements!
package mortgagecalculation2a;
import java.text.NumberFormat;
import java.util.Scanner;
/**
*
* @author Akira
*/
public class MortgageCalculation2a {
That didn't work.
if (loanAmount < 0)
{
System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
}
else if (interestRate < 0)
{
...
Okay so I tried option 1 and 2 and it still does the calculation at the end. Also, how would I make it so "The monthly payment is: " not even show up, this is what I was trying to do in the...
if (loanAmount < 0)
{
System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
...
Still confused because you said everything you put in the else if block doesn't execute and if loanAmount and the other variables is less than zero I don't want the equation to be executed.
if (loanAmount < 0){
} else if (monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1)){
...
Well I tried putting the equation in there...all i got was a red bar so that didnt work and I dont know what else to put so I asked, sorry.
So I what would I put in the else block? Should I put the monthlyPayment equation so that the calculation will not execute then just do a system.out.println of the message? Also, would I have to...
It basically told me what I already know....
It does not for a fact tell me how I can make it so the message only shows up once as the output and doesn't still do the calculation. I know it's all...
I already checked out that website before posting, that is why I posted. I didn't really see the help in it. It doesn't say anywhere how to do the question I asked.
--- Update ---
How do I...
Okay so here is my code. For my project we have to calculate the monthly payment for a mortgage. My professor wants us to set it up so when someone enters a negative number for any of the inputs it...
trust me ive been trying. I use netbeans so maybe its different but i cant find anywhere a compile button.
How do I do that? I hover my mouse over the red bar and it says ')' unexpected
--- Update ---
Compiling 1 source file to E:\MortgageCaculation\build\classes...
here is a pic of my code if that helps
2341
Oh I guess I didn't really state that clearly. We have to calculate a monthly mortgage and my professor gave me this equation we have to use and its
monthly payment = rate x amount x...
So I need to find the monthly payment for a motgage and I can't seem to find what is wrong with my equation, someone help please!
monthlyPayment = taxRate * loanAmount * ((Math.pow(1+taxRate,...