public class Test { publicstatic void main(String[] args) { System.out.println(t1(10)); System.out.println(t2(2,3)); }
/** * (1) A=Pi*r^2 - formula for the area of acircle * * @param r - radius of the circle * @return */ publicstatic double t1(double r) { returnMath.PI*r*r; }
/** * (2) C=n!/r!(n-r)! - combination Inmathematics a combination is a way of * selecting several things out of a largergroup, where (unlike * permutations) order does not matter. * * @param r * @param n * @return */ publicstatic int t2(int r,int n) { returnfact(n)/(fact(r)*fact(n-r)); } /** * factorial calculation * @param n * @return */ publicstatic int fact(int n) { if(n<1) { return1; } else { returnn*fact(n-1); } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment