Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hsa.*;
- // AVERAGE CALCULATION RIGHT HERE FOR INTS//
- public class henryutils{
- public static int averageCal(int intNum1, int intNum2){
- int intTotal;
- int intAverage;
- intTotal = intNum1 + intNum2;
- intAverage = intTotal/2;
- return intAverage;
- }
- //AVERAGE CALCULATION FOR DOUBLES
- public static Double dblaverageCal(double dblNum1, double dblNum2){
- double dblTotal;
- double dblAverage;
- dblTotal = dblNum1 + dblNum2;
- dblAverage = dblTotal/2;
- return dblAverage;
- }
- //SPHERE AREA
- //REVISE
- public static Double spherearea(double dblRadius){
- double dblAreaFinal;
- dblAreaFinal=4/3*3.141592654*Math.pow(dblRadius,3);
- return dblAreaFinal;
- }
- // BACKWARDS CALCULATION!!!!!//
- public static String backwardsName(String strWord){
- String strBack;
- String strLetter;
- int intCounter;
- int intLength;
- strBack = "";
- intLength = strWord.length();
- // Breaking of the Word
- for(intCounter = intLength; intCounter > 0; intCounter--){
- strLetter = strWord.substring(intCounter - 1, intCounter);
- strBack = strBack + strLetter;
- }
- return strBack;
- }
- //PAUSE METHOD!//
- public static void pause(int intMS){
- try{
- Thread.sleep(intMS);
- }catch(InterruptedException e){
- }
- }
- //LOGO HERE
- public static void henryLogo(Console con){
- con.println("The best programming company in the world is");
- con.println(" * * **** *");
- con.println(" * * * * *");
- con.println(" ***** * * *");
- con.println(" * * * ** ");
- con.println(" * * * * ");
- con.println("Henry Productions");
- }
- //INTEREST METHOD
- public static Double dblinterest(double dblPrinciple,dblPercentageRate,intMonths){
- dblInterest = 0;
- // double dblPrinciple;
- // double dblPercentageRate;
- double dblResult;
- dblInterest=dblPrinciple(Math.pow(1+(dblPerecentageRate/100),intMonths)) - dblPrinciple;
- return dblInterest;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement