Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help with these Java questions about methods. Feel free to answer in full

ID: 664149 • Letter: P

Question

Please help with these Java questions about methods. Feel free to answer in full or just direct me down the right path.

Java Project 4/src/WelcomeMessage.java - Eclipse Java Project 4/src/WelcomeMessage.java - Eclipse w Help Quick Access WelcomeMessage javaQuiz javaTestMessage java 7create customized message message "Hello " firstName "" lastName ". Welcome to CS1323. The online" is 16 3/ 8 loutput Section s " course on Introduction to Computer Programming. Programming is fun" + “ like playing your favorite game, " + game + ". Happy Learning!! !"; ike playing your favorite game, "game ". Happy Learning!!!"; System.out print (message); //End of Main Program 40 13 //Method·This method would take the descriptor (like "game" above), as the student MA /f For input (like "soccer"), and return the reference for the String object the user //enters. This. 19 //enters This .5 method should be alled three times in the described program (for 6 /each respective input) 7 public static String replaceDescriptorwithword(String descriptor, Scanner keyboard) be sta trngpcebescr iptorwithiord(String descriptor, Scanner keyboard) AH 18 49 Line: 43 A /Method 2 Wil1 be called only once for printing the custom message 5public static String customiMessage() string firstName; String lastName string game Problemns Javador Declaration Console No consoles to display at this time Writable Smart Insert 49:9

Explanation / Answer

The imported Scanner class is from the java.util package. The Scanner class allows us to create a object to type different values on the console. Where System.in reads the values from the console. The main class is WelcomeMessage which has 4 string variables. These variables are stored from System,in into input object of Scanner class. Each value is stored one after other through the input.next() method. So, here intermediate method input.next() access the values and assigned in their own variables. Line number 34 statement is a string variable (message) to concatenate variable values typed at runtime. Line number 39 is the output statement for the main class, System.out.print(message) which result concatenated message. Lines number 41 to 66 are comments. So, these comments will not result anything