Description
PRG420 Week 1 Individual Assignment Coding a Simple “Hello, world!” Java Program
Individual: Coding a Simple “Hello, world!” Javaâ„¢ Program
Includes Working Java Build and Program File and Explanation of Code
Resource: Week One Coding Assignment Zip File (starter code for this assignment that includes placeholders)
For this assignment, you will apply what you learned in analyzing a simple Javaâ„¢ program by writing your own Javaâ„¢ program. The Javaâ„¢ program you write should do the following:
• Display a prompt on the console asking the user to type in his or her first name
• Construct the greeting string “Hello, nameEntered!”
• Display the constructed greeting on the console
Complete this assignment by doing the following:
1. Download and unzip the linked zip file.
2. Add comments to the code by typing your name and the date in the multi-line comment header.
3. Replace the following lines with Javaâ„¢ code as directed in the file:
• LINE 1
• LINE 2
• LINE 3
• LINE 4
4. Comment each line of code you add to explain what you intend the code to do.
5. Test and modify your Javaâ„¢ program until it runs without errors and produces the results as described above.
Note: Refer to this week’s analyzing code assignment if you need help.
Submit your Java source (.java) code file using the Assignment Files tab.
/**********************************************************************
*Â Program:Â PRG420Week1_CodingAssignment
* Â Purpose: Week 1 Individual Assignment #2
*Â Programmer:Â YOUR FULL NAME GOES HERE
*Â Class:Â PRG/420 PRG420 PRG 420
*Â Creation Date:Â TODAY’S DATE GOES HERE
*********************************************************************
*
**********************************************************************
*Â 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.
}
}
Reviews
There are no reviews yet.