follow the To Do list in the comments to finish the program, and send a response to this topic with your .class files attached. Also, please include your name in the output as the program's author. /* Week2 in-class exercise Name: myName.java Author: Date: */ //import the Scanner class to get user input import java.util.Scanner; public class myName { public static void main(String[] args) { // TO DO: // // a. Create a new Scanner to get user input // b. Prompt the user to get the name // c. Get user's name input and assigned to a name variable // d. Display a welcome message, such as: // "Hello, name, welcome to BIFS618!" System.out.println("Author: Your Name"); } }
/* Week2 in-class exercise Name: myName.java Author: Date: */ //import the Scanner class to get user input import java.util.Scanner; public class myName { public static void main(String[] args) { // a. Create a new Scanner to get user input Scanner scanner = new Scanner(System.in); // b. Prompt the user to get the name System.out.print("Enter your name: "); // c. Get user's name input and assigned to a name variable String name = scanner.nextLine(); // d. Display a welcome message, such as: // "Hello, name, welcome to BIFS618!" System.out.println("Hello, "+name+", welcome to BIFS618!"); System.out.println("Author: Your Name"); } }
Get Answers For Free
Most questions answered within 1 hours.