answersLogoWhite

0

public class SimpleInterest{

float principal,intRate, numOfYears;

public void setPrincipal(float principal){

this.principal = principal;

}

public void setIntRate(float intRate){

this.intRate = intRate;

} public void setNumOfYears(float numOfYears){

this.numOfYears = numOfYears;

} public float calculateSimpleInterest(){

return (this.principal * this.intRate * this.numOfYears) /100; } public static void main(String argv[]){

float principal,intRate, numOfYears;

SimpleInterest simpIntObj = new SimpleInterest();

principal = Float.parseFloat(argv[0]);

intRate = Float.parseFloat(argv[1]);

numOfYears = Float.parseFloat(argv[2]);

simpIntObj.setPrincipal(principal);

simpIntObj.setIntRate(intRate);

simpIntObj.setNumOfYears(numOfYears);

System.out.println ("Principal = "+principal);

System.out.println ("Interest Rate = "+intRate);

System.out.println ("Num of Years = "+numOfYears);

System.out.println ("Simple Interest Amount = "+simpIntObj.calculateSimpleInterest());

} }

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

Can you get a Java program to find the cube of a number?

Yes


How do you write a java program to find the ad joint of a matrix?

bgfygfrhjyuyhh


How do you write a java program for finding multiligual languages?

You can use Java's built-in functions to write a code that will find multilingual languages.


Where can someone find information on the Java language for no such method error be found?

"No such method" is an error message that may appear when attempting to create a program with Java. Users who understand the Java programming language can find an answer on websites such as Stack Overflow and Crafting Java.


Where can one find a compound interest calculator?

You can find compound interest calculators online on financial websites, as well as on banking or investment platforms. Additionally, many mobile apps are available that offer compound interest calculators for easy and convenient use on smartphones or tablets.


Jntu 2-2 oops through java answers?

write a java program to find factorial using recursive and non recursive


How do you write a java program to find the square root of a number?

You can use the Math.sqrt() method.


How do you get memory information in Java program?

You can use the following to find out the memory usage information for a Java Program:Runtime.getRuntime().maxMemory()Runtime.getRuntime().totalMemory()Runtime.getRuntime().freeMemory()


Find compound interest on Rs800 for 3 years at an interest 8 percent compounded semiannually for three years Find the compound inte?

800 x (1.04)6 ie Rs1012.26


How do you find quarterly compound interest?

it is zero i'm a bad boy


What is the equation to find compound interest?

If the rate of annual interest is r% the period is n years and the amount invested is y Then the compound interest is y*(1+r/100)^n - y


Can you create java program for me?

You can find lots of sample Java programs on the Internet. If you need something customized, you can hire programmers in sites such as ODesk, ELance, and others.