Word Potential is the sum of the ASCII characters of the word.
Example: “Code”. C+o+d+e = 67+111+100+101 = 379.
Java
import java.util.*;
public class WordPotential
{
public static void main(String args[])
{
String str="";
char ch=' ';
int l=0,pot=0;
Scanner sc=new Scanner(System.in);
System.out.print("Enter a word: ");
str=sc.next();
str=str.trim();
l=str.length();
for(int i=0;i<l;i++)
{
ch=str.charAt(i);
pot=pot+ch;
}
System.out.println("Potential of the word: "+pot);
}
}Java