-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMathbox.java
More file actions
42 lines (42 loc) · 1.02 KB
/
Mathbox.java
File metadata and controls
42 lines (42 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Math-box is a simple math functions library designed to process basic math formulae.
* Author: Arnav M. Kamath
*/
public class Mathbox
{
public int Area(int l, int b)//Area of rectangle
{
int area = l*b;
return area;
}
public double Area(int a, int b, int c)
{
int s = (a+b+c)/2;
int h = s*((s-a)*(s-b)*(s-c));//Heron's Formula
double area = Math.sqrt(h);
return area;
}
public double CompoundI(int p,int r,int t)//Compound Interest
{
double intr = Math.pow((p/r+1),t);
return intr;
}
public int SimpleI(int p,int r,int t)//Simple Interest
{
int interest = (p*r*t)/100;
interest = interest + p;
return interest;
}
public double Area(int r)//Area of Circle
{
double area = 2*(22/7)*(r*r);
return area;
}
public double Pythogras(int a, int b)//Pythogras Theorem
{
a = a*a;
b = b*b;
double c = Math.sqrt(a + b);
return c;
}
}