Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. public class Functionality {
  3.  
  4. public static void main(String[] args) {
  5.  
  6. }
  7. public static String stringMean(String a){
  8. String f = "";
  9. if(a.length() > 0){
  10. int b = a.length();
  11. int c = 0;
  12. while(b>0){
  13. c = c + (int)a.charAt(b-1);
  14. b=b--;
  15. }
  16. double d = c / a.length();
  17. int e = (int)Math.round(d);
  18. f = Integer.toString(e);
  19. }
  20. return f;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement