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());
} }
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float p,t,r;
float i,ci,a;
clrscr();
printf("enter the principal:\t");
scanf("%f",&p);
printf("enter the rate of interest:\t");
scanf("%f",&r);
printf("enter the time in years:\t");
scanf("%f",&t);
if((p<0)(t<0)(r<0))
printf("invalid");
else
{
i=(p*t*r)/100.0;
printf("the simple interest is rs.%.2f",i);
a=(float)p*(pow(1+r/100.0,t));
ci=a-p;
printf("the compound int is rs.%.2f",ci);
}
getch();
}
public doublecalculateInterest (intprinciple, int rate, int numOfYears) {
doubleinterest = (principle * rate * numOfYears)/ 100;
return interest;
}
double futurevalue = Principle*Math.pow (1 + interest, numberofyears);
I think maybe :)
ghsksjdkjdfldfklor
Yes
sum = 0; for (int i = 12; i
In the same way as you would compile and execute any other Java program. Compile: use the "javac" command. Or use the built-in "compile" command in your favorite IDE. Execute: Use the "java" command. Or use the built-in "run" command in your favorite IDE.
You can have the below line as the first and last line of the program and find out the difference in time taken to calculate the execution time. This will print the system time in the console which can be used to calculate execution time.System.currentTimeMillis();
Reference:cprogramming-bd.com/c_page1.aspx#simpleinterest
Yes
bgfygfrhjyuyhh
You can use Java's built-in functions to write a code that will find multilingual languages.
"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.
One can find a bunch of compound interest calculators online. Some of the sites that one can use are called, moneychimp, mathisfun and thecalculatorsite.
write a java program to find factorial using recursive and non recursive
You can use the Math.sqrt() method.
800 x (1.04)6 ie Rs1012.26
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()
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
it is zero i'm a bad boy
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.