Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started