Mortgage Amortization Calculator

Feb 11, 2015

import java.util.Scanner;
public class Project1 {
private static int interestYears;
private static int numberYears;
public int interest;
private static double intresetMonth;

[Code] ....

View Replies


ADVERTISEMENT

GUI Mortgage Calculator With No Functionality

Apr 18, 2015

How to make my program look nice. I have to create a mortgage calculator with no functionality, so it basically just has to be a window that looks like this:

Here's my code:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MortgageCalculator {
public static void main(String[]args) {
CalcWindow calculator = new CalcWindow();

[Code] .....

Here is the output I am getting:

How do I make my program output look similar to the 1st picture?

View Replies View Related

Mortgage Calculator - Monthly Payment Is Not Getting Out Correctly

Sep 25, 2014

This is for a mortgage calculator and we have to use the math.pow method. I am getting results, but the results are wrong. The monthly payment is coming out to big.

Here is what it should be:

Enter loan amount: 10000
Enter rate: 4.5
Enter number years: 3

The monthly payment is: $297.47

Here is what I'm getting.

Enter loan amount: 10000
Enter rate: 4.5
Enter number years: 3

The monthly payment is: $566.06

Here is my code. I believe my issue is in the math.pow formula.

Scanner in = new Scanner(System.in); // input object

double loanAmount; //user input
double interestRate; // user input
double yearNumber; // user input
double monthlyPayment; // answer to math
double finalPayment; // output
double monthNumber; // year number converted of months
double monthlyRate; // converted intersted rate

[Code] ....

The monthly payment is: $%.2f", monthlyPayment); // Shows monthly payment

View Replies View Related

JTable - Amortization Schedule Calculator

Jan 26, 2014

I am creating an amortization schedule calculator and I'm having a bit of trouble with adding my table to the screen after I calculate everything.

Here's my code. The problem is that in the calculatePayments() method, I want the JTable to be added to the JScrollPane but it doesn't seem to be working.

Java Code:

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

[Code] .....

View Replies View Related

Amortization Algorithm - Loan Calculator That Uses Compound Interest

May 21, 2014

I'm making a loan calculator that uses compound interest... I need the program to return the monthly payment, how much of it is principal and how much of it is interest, which depends on how many months into your loan you are... So basically all I need is the algorithm to calculate how much of your monthly payment (depending on how many months in you are) is interest and how much of it is principal.

View Replies View Related

Printing Amortization Table For Program

Jul 15, 2014

I am still having trouble with printing an amortization table for my program. This is the example the professor gave us and our program has to print exactly like this:

Please enter the amount of the loan (a number less than $1,000,000.00) 1000.00
Please enter the annual interest rate (between 2.0 and 15.0 inclusive) 10
Please enter the term of the loan (a number of years between 1 and 30 inclusive) 1
Your monthly payment is 87.92
| INTEREST | PRINCIPAL
MONTH 1 : 8.33 79.58
MONTH 2 : 7.67 80.25

[code]....

So far I have it so it works up to the table. How to get it to loop so it will print each month with the principal and interest. This is the part im having trouble with:

double principal = amount;
double principalPaid;
double interest;
double totalInterest;
double balance = amount;

[code]....

View Replies View Related

Tip Calculator For Fun

Oct 18, 2014

So, I'm working on a Tip Calculator for fun. I have everything worked out for the most part. The feature I am trying to add is to give the user the amount of change they'll get back from their transaction. I do not ask the user any information other than what is their bill.

Please enter your bill total : 5.50
Please enter your name : some name
Total : 5.50
Tax : 0.48 -- Based off a tax rate of 8.75%
Total with Tax : 5.98 --
20 percent Tip : 1.10
Total with Tax and 20 percent Tip : 7.08
Total change : <-- I believe this will be about $2.92

I want the total bill to round to the nearest $10 value (e.g. for $5.50, calculate bill to $10. For $13.00, calculate bill to the $20.00, and so on... This way I get an accurate amount of change to give back to the user.

View Replies View Related

MVC Calculator - How To Get It To Actually Calculate

Sep 28, 2014

I made a MVC calculator. I was wondering if you could take a look at my design and if I was on track. I am still working on getting it to actually calculate something. All the buttons respond and print text on the JTextField but it is not calculating.

package calculator.MVC;
import javax.swing.JButton;
import javax.swing.JTextField;
public class CalculatorModel {
private int sum;
private int number;
private char opt;

[code]....

View Replies View Related

Calculator Only Return 0.0?

Sep 2, 2014

I am making a calculator in Java. However, when I press the "=" button on my calculator, it always returns 0.0, no matter what. I don't understand why? The code is below:

import javax.swing.*;//import the packages needed for gui
import java.awt.*;
import java.awt.event.*;
import java.util.Arrays;
import java.util.List;
import static java.lang.Math.*;
public class CalculatorCopy {

[Code] ....

View Replies View Related

How To Add Loop In Calculator

Mar 11, 2015

import javax.swing.*;
public class BasicCalculator{
public static void main (String[] args) {
String output="";
double n1,n2;
String operation;
operation= JOptionPane.showInputDialog("Please enter your operation");

[Code] ....

How to add a loop in this problem:

View Replies View Related

While Loop Pay Calculator

Dec 2, 2014

I have the basic workings of this program just doing all the printing at the end is throwing me off. Anyway here are some of the requirements and my code:

1. Allow the user to input an individual's hours worked.
2. Accumulate the total regular hours worked, the overtime hours worked, the amount of the regular pay, the amount of overtime pay, and the total payroll, for all of the employees entered.
3. Allow the user to enter a zero (0) as the Boolean expression to end the loop.
4. When the loop ends print out all of the accumulated totals with appropriate labels, each on a separate line.

import java.util.Scanner;
public class WhileLoopPayCalc
{
public static void main(String [] args)
{
final double REGULAR_HOURS = 40f;
final double HOURLY_WAGE = 12.5f;
final double OVERTIME = 1.5f;

[code]....

View Replies View Related

Calculation In Awt Calculator

Jul 10, 2014

I am facing problem during calculation in my awt calculator. It is showing NumberFormatException. Below is part of code.

if(e.getSource()==b14)//On button 14, label is "/"
{
String v1=tf.getText().toString();
num1=num1+Integer.parseInt(v1);//num1 is as integer variable
tf.setText("");//tf means textField
}else

[code]....

View Replies View Related

Calculator In Java

Oct 28, 2014

I can not this to work correctly.

public static void main(String[] args) {
FloatWrapper x1=new FloatWrapper(0);
FloatWrapper x2=new FloatWrapper(0);
do{
switch(menu()){
case 'a': if(dataInput(x1,x2)) add(x1,x2); break;
case 'b': if(dataInput(x1,x2)) subtract(x1,x2); break;

[code]....

View Replies View Related

Trying To Create A Calculator

Sep 16, 2014

I'm new to java and have been coding for a few hours. I tried to create a calculator (Which has no GUI, just text inputs)which will let you select how to process the two integer (Add, minus, times etc.) I cant seem to get it to work. I will put in the process way such as times and have entered two integers and every time it doesn't work. Here is my code:

import java.util.*;
public class Calculator
{
public static void main (String args[])
{
int input1 = 0;
int input2 = 0;
int answer = 0;

[code]....

View Replies View Related

Create A Calculator With JCreator

May 24, 2010

I have got a problem when coding a java program to create a calculator with JCreator. How to write codes for decimal point.

Decimal point should not be set to the text more than 1 time until an operator is pressed. How can I use a Boolean value to solve this problem.

View Replies View Related

Calculator That Change Input Value Into Another Value

Nov 14, 2014

I am currently working on a small java programm. I use netbeans for it. And obviously I am new to java.

Basically its a calculator that change the input value into another value: like 10 € into whatever $ and same with Inch and Centimeters.

Therefore I need a second jDialog Form where i can change the factors for the calculator and start the calculator again.

Here is my problem: I can open the second Dialog but if I want to change the factor it doesn't change the value in the variable and the second calculator frame is with the old factors. It seems the double variable isn't working globally

I will add the files later when i find out how?

View Replies View Related

PostFix Calculator Project?

Apr 2, 2015

So I am working on a PostFix calculator that is used in command line for a class project, and I am having a little trouble on developing a memory for it. I have been told to create a hashMap and I have researched it and understand the basics of it. I have the calculating method working, but what I am having trouble trying to implement a way for the user to declare variables. For example this what the user should be able to do:

> a = 3 5 + 1 -
7
> bee = a 3 *
21
> a bee +
28

[code]....

I just need to be able to save the answers as a variable the User names, such as the example and let the user be able to use the variables later.

View Replies View Related

Random Number Calculator

Feb 1, 2015

the program basically has a random number generating, and I want to ask the user to try to guess the number, and keep guessing until the number is right. In addition to this, I need to put in extra conditions for too high or too low by 10. So for example, if they user guesses a number and its off by more than 10, then it prints that they guessed too high, and if its below 10 they guessed too low.

import java.util.*;
public class RandomNum
{
public static void main(String[] args)
{

Scanner scan = new Scanner(System.in);

[code].....

Modify the program to keep the user trying to guess the number till he/she gets it right, and stop once you guess the right number.Too high, high, too low, too low( If it's off by more than 10 = way too high, if its less than 10, way too low)

View Replies View Related

Basic Calculator Functions

Jul 2, 2014

my task is to add a few functions to an example calculator. I managed to add a divide button but I simply can't figure out how to add a working Pi and reciprocal function.

package newjavaproject;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class CalculateurNC extends Applet {

[code]....

View Replies View Related

How To Make Calculator Using Stacks

Feb 5, 2014

I got to make a java code for my class. I must make a calculator using stacks. I have a code but i got some mistakes. Here is the code

Java Code:

package stackscalc;
import java.util.Scanner;
import java.util.Stack;
import java.util.EmptyStackException;
class Arithmetic {
int length;
Stack stk;
String exp,

[Code] .....

View Replies View Related

Else Without If Error - Simple Calculator Using JOP

Oct 8, 2014

import javax.swing.JOptionPane;
public class Calculator {
public static void main ( String args[] ) {
double n1 = Double.parseDouble(JOptionPane.showInputDialog(" Enter first number: "));
double n2 = Double.parseDouble(JOptionPane.showInputDialog(" Enter second number: "));
String x = JOptionPane.showInputDialog("Enter operator: ");
double result;

[code].....

Write a program that mimics a calculator. The program will need to accept as input two numeric double values, and accept the operation to be performed as the third input. The operation to be performed will be input in the form of the character representing the java operator for the operation to be performed (i.e + for addition, - for subtraction, * for multiplication, / for division, or % for modulus). Once the program has read these 3 inputs it should output the numbers, the operator, and the result. (For division, if the denominator is zero, the program will output an appropriate message (i.e division by zero is an invalid operation). Please use the JOptionPane class for both accepting the required inputs and for the required output demonstrated below.Some sample output may look as follows:

3 + 4 = 7
13 * 5 = 65
10 / 3 = 3.33333333

Error Messages:
3 errors found:
File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 23]
Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:23: 'else' without 'if'
File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 31]
Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:31: 'else' without 'if'
File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 37]
Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:37: 'else' without 'if

View Replies View Related

Make A Calculator Using Java GUI

Jul 29, 2014

I am trying to make a calculator using Java GUI. I've managed to make an ActionListener and add it to a button, but I've made an error in my code that I'm unsure of how to solve. Because of how I've written the code, only one number can be placed in the text field. For example, the an ActionListener for the three button on the calculator was added to the button, but no matter how many times the user presses the button, only one 3 will appear in the text field. The code is below:

import javax.swing.*;//import the packages needed for gui
import java.awt.*;
import java.awt.event.*;
public class Calculator {
public static void main(String[] args) {
JFrame window = new JFrame("Window");//makes a JFrame
window.setSize(300,350);

[code].....

As you can see, because the compiler forces the String variable to be final, so when the user presses the button, the code simply shows how a space character and three character would look like, because the String variable can't change. How do I write my code so that every time the user presses the button, a character is added to the text field?

View Replies View Related

Basic Cost Calculator

Oct 20, 2014

Why I am getting errors for this program I (tried) to write. I am new to java.

import java.util.Scanner;
public class TheBarkingLot {
public static void main(String args[]) {
int n;
Scanner input = new Scanner(System.in);
System.out.println("How many large dogs are boarding today?");

[Code] ....

View Replies View Related

Adding Functions To A Calculator

Dec 6, 2014

I've made a calculator that can add, subtract, multiply, and divide, but I still need a clear function and a square root one for it. I've tried going on the various calculator tutorials, but they don't work.

And here's my code:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Calculator extends JPanel implements ActionListener
{
private JTextField display = new JTextField("0");
private String button = "789/456*123-0.+=";
private double result = 0;

[Code] .....

View Replies View Related

Make A Calculator Using Stacks

Feb 4, 2014

i got a problem with this program.I am supposed to make a calculator using stacks but it seems that i m stack. i can t get the right recognition

for () and {} []

its not necessary to use all these symbols.just a simple () will do .here s the program

package stackscalc;
 
import java.util.Scanner;
import java.util.Stack;
import java.util.EmptyStackException;
class Arithmetic
{
int length;
Stack stk;
String exp,
postfix;
 
[code]....

View Replies View Related

Basic Grade Calculator

Jan 24, 2015

im considered quite the "javanoob" as my account name states..The assignment is to basically take a number that is entered by a user, and based off what they type in, display a corresponding grade letter. For example, if they enter a number between 90-100, they should receive a response that they received an "A". Now, this is fairly simple using an if/else statement, but my professor wanted us to implement this, using a switch case to teach us the difference.

import java.util.*;
public class SwitchTest
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);

System.out.println("Please enter a number to find out what letter grade you have recieved");

[code]...

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved