Question: Problem #2: Reading input You will write a program from scratch that accomplishes the following: . Create a new Java class file named simpleInput .


Problem #2: Reading input You will write a program from scratch that accomplishes the following: . Create a new Java class file named simpleInput . Create a Scanner object to read from the console Prompt the user for their first name on one line (use println for prompt) User will enter the name on the next line, you should read in the name value . Print a message that says hello to the user (i.e., "Hello ") on the next line . Skip a line, then prompt the user for the year they were born on a line by itsefl (use println for prompt) . Read in the value (which will be on its own line) Print the year they were born on the next line . Calculate and print the age the user will be this year on the next line * Declare a constant for average life expectancy, set its value to 76.9 . Print the percentage of their expected life they've lived on the next line Skip a line, then prompt the user for what they believe the value of Pi to be on a line by itself (use println) . Read in the value (which will be on its own line) . Print the value they entered on the next line Print how close they are to the actual value of Pi (22 divided by 7), print just the numerical difference
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
