Question: Submit the Java source file containing a Java program which prompts the user to enter the name of the person. Stores the name of person
Submit the Java source file containing a Java program which
- prompts the user to enter the name of the person.
- Stores the name of person in a string variable.
- Prompts the user to enter the age of the person.
- Stores the age of the person in a variable of type Integer.
- Retrieve each ascii value of each character of the stored name (which was done in step 2).
- To get the ascii value of a character value...just cast it to int. for example.
Char c = 'a';
int asciival = (int) c;
- Calculate the sum of all ascii values of each character in the name and store it in a variable of type double.
- Divide the calculated sum of ascii values by the stored age of the person and store it in a variable of type double.
- Display the above calculated value as "Astrological Code" with decimal points upto 2 places.
- Display all the other values stored and calculated above
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
