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

  1. prompts the user to enter the name of the person.
  2. Stores the name of person in a string variable.
  3. Prompts the user to enter the age of the person.
  4. Stores the age of the person in a variable of type Integer.
  5. Retrieve each ascii value of each character of the stored name (which was done in step 2).
    1. To get the ascii value of a character value...just cast it to int. for example.

Char c = 'a';

int asciival = (int) c;

  1. Calculate the sum of all ascii values of each character in the name and store it in a variable of type double.
  2. Divide the calculated sum of ascii values by the stored age of the person and store it in a variable of type double.
  3. Display the above calculated value as "Astrological Code" with decimal points upto 2 places.
  4. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!