Answered step by step
Verified Expert Solution
Question
1 Approved Answer
// Chapter 3 Programming Activity //1. add your import statements here public class PracticeMethodsi public static void main String [ //2. a. Create a Scanner
// Chapter 3 Programming Activity //1. add your import statements here public class PracticeMethodsi public static void main String [ //2. a. Create a Scanner object to read from the keyboard b. Prompt the user for his/her first name c. Print a message that says hello to the user d. Print a message that says how many letters are in the user's name / Your code goes here 13. Print an empty line // Your code goes here //4. a. Using previously created Scanner object prompt the user for the year (s)he was born b. Calculate and print the age the user will be this year (prompt the user for the current year) c. Declare a constant for average life expectancy, set its value to 78.74 d. Print a message that tells the user the percentage of their expected life they've lived. Use the Desimalkeruak class to format the percentage / Your code goes here 15. a. Create a Random object and generate a random integer between 1 and 20 inclusive b. Using previously created Scanner object prompt the user for a guess c. Print a message that tells the user the number and how far from the number the guess was (hint: use Matb abs) / Your code goes here
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