Question: DESCRIPTION Complete the method welcome() and create and complete the method goodbye() to print a welcome message and a goodbye message to the user, given
DESCRIPTION
Complete the method welcome() and create and complete the method goodbye() to print a welcome message and a goodbye message to the user, given their name. The main() method has already been completed and gets the user's name from input. The main() method then calls the welcome() and goodbye() methods to print the two messages.
Your task is to complete the welcome() method that has already been started for you and to create and complete a goodbye() method, as described in the comments.
import java.util.Scanner; public class Messages { public static void main(String[] args) { //get the user's name System.out.println("What is your name?"); Scanner scnr = new Scanner(System.in); String name = scnr.nextLine(); //call the methods below to print a welcome message and a goodbye message welcome(name); goodbye(name); } //end main /* * complete the method below to print a welcome message: * "Welcome to the program,
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
