View the step-by-step solution to:

Program Summary: This program asks the user for a one-word name * and then displays a constructed greeting * that looks like this: * * Hello, NAME!

Program Summary: This program asks the user for a one-word name

*            and then displays a constructed greeting

*            that looks like this: 

*

*            Hello, NAME!

**********************************************************************/


package prg420week1_codingassignment;


/**

 *

 * @author NETBEANS PLACES YOUR INITIALS HERE

 */



import java.util.Scanner;


public class PRG420Week1_CodingAssignment {

   

  public static void main(String[] args) {

    // Create a usable instance of an input device  

    LINE 1. INSTANTIATE AN INSTANCE OF SCANNER AND ASSIGN IT TO A VARIABLE OF TYPE SCANNER. 


    // Prompt user for input

    LINE 2. USE THE PRINT() METHOD TO PROMPT THE USER FOR HIS OR HER FIRST NAME.


    // Capture first word and assign it to A VARIABLE

    LINE 3. USE THE NEXT() METHOD OF YOUR SCANNER INSTANCE TO ASSIGN A VALUE TO A STRING VARIABLE.


    // Construct the greeting 

    LINE 4. USE THE PRINTLN() METHOD TO CONSTRUCT A CORRECTLY PUNCTUATED GREETING.


  }

   

}

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question