/* Chapter 3 Programming Activity 2 Calling class methods Anderson, Franceschi */ // ***** add your import statements here public class PracticeMethods { public static void main(String[] args) { //***** //1. a. Display a message using JOptionPane. // b. The message should include your user name. // Your code goes here //***** // 2. a. Create a Scanner object to read from the console // b. Prompt the user for their 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 //***** // 3. a. Skip a line, then prompt the user for the year // they were born. // b. Calculate and print the age the user will be this year. // c. Declare a constant for average life expectancy, // set its value to 77.9 // d. Print a message that tells the user the percentage // of their expected life they've lived. // Use the DecimalFormat class to format the percentage // Your code goes here //***** // 4. a. Generate a random integer between 1 and 20 // b. Pop up an input dialog box and ask the user for a guess. // c. Pop up an output dialog box telling the user the number // and how far from the number the guess was (hint: use Math.abs) // Your code goes here //Do not remove this statement System.exit(0); } }