need help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

need help

rebelxdrebelxd Posts: 8Member
i am making a program that asks the user to enter a password nd then The program finds the total of adding the integer value (ASCII value) of each of the characters in the password,, so if the user entered "dog" as the password
d has ASCII value 100
o has ASCII value 111
g has ASCII value 103
So d + o + g = 100 + 111 + 103 = 314

i am having a problem adding the ascii values can some1 plz help me?

this is my code so far
System.out.print("What is the password>. ");
phrase = keyboard.nextLine();

for(int i =0; i <phrase.length(); ++i)
char a = phrase.charAt();
int b = (int) a;


Sign In or Register to comment.