Submit the Java source file containing a Java program which prompts the user to enter the name
Fantastic news! We've Found the answer you've been seeking!
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 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
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: