473,387 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Some one please Help

1
I have a assignment and I cant figure out why the payment value cannot be resolved.. Can anyone help?

import java.util.*;

public class HW8 {
public static double payment(double amnt, double intrate, int mths){
double mnthpymnt;
mnthpymnt= amnt*((intrate)*(Math.pow((1+intrate),mths))/(Math.pow((1+intrate),mths)-1));

return payment;
}
public static double balance2(double balance, double intrate, double mnthpymnt ){
double pramnt, intamnt, endbal;
intamnt= intrate*balance;
pramnt=mnthpymnt-intamnt;
endbal= balance-pramnt;

System.out.printf("The interest is $%.2f and the principle is $%.2f %n", intamnt, pramnt);
return endbal;}
public static void main ( String[]args){
Scanner hw=new Scanner(System.in);
int index;
double mnthamnt, endbal;
System.out.println("What is the amount of the loan?");
double amnt= hw.nextDouble();
System.out.println("What is the interst rate?");
double intrate=hw.nextDouble();
System.out.println("What is the yearly loan period?");
int mths=hw.nextInt();
System.out.printf("The amount of the loan is $%.2f%n", amnt);
System.out.printf("The interest percentage on the loan is %.1f %n", intrate);
mths=mths*12;
System.out.printf("The duration of the loan in years is %n", mths);

intrate=(.01*intrate)/12;
mnthamnt= payment(amnt,intrate, mths);
System.out.printf("The monthly payment is $%.2f %n", mnthamnt);
endbal= amnt;
for(index=0; index<mths; index= index+1)
endbal=balance2(endbal,intrate,mnthamnt);}



}
Nov 22 '07 #1
0 891

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
3
by: Mike | last post by:
Hey guys I am pulling my hair out on this problem!!!!! Any help or ideas or comments on how to make this work I would be grateful! I have been working on this for the past 4 days and nothing I do...
1
by: et_pooh1981 | last post by:
i am doing a project with word prediction.. but i donno where i start.. some people suggest me to use hook some people suggest me to use IPC ( inter process communication) but my teacher suggest...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
2
by: Ivan | last post by:
Recently i have encounter some problem with C# programming. The application of mine can't seem to run well with sql server 2000 and i think the reason for this is the connection between this two...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
1
by: albert_reade | last post by:
Hello I was wondering if someone could please help me understand what I need to do in order to get this project to work. I just need some hints or a push in the right direction to get this to work,...
2
by: cephal0n | last post by:
I have this peroblem thats really bugging me for days, please have a patience to read it and help me find the probplem because I knew I missed it and just cant tell where. I have a table named...
10
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.