Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

IN JAVA CODING Using the Lab 1 Hello World assignment from Module 1, do the following: Rename the java file YourLastNameLab2. Rename the java class

IN JAVA CODING

Using the Lab 1 Hello World assignment from Module 1, do the following:

  1. Rename the java file YourLastNameLab2.
  2. Rename the java class by the same name as the java file.
  3. Prompt the user to enter their name.
  4. Print out the word "Hello" with the user's name before printing out "Hello World!"

For example, if the user enters "Kermit" as their name then the program will print out the following:

"Hello Kermit! Hello World!"

Don't forget to print a space between the two sentences!

NOTE: 1. Declare all variables within the data declaration section. 2 Do not get input on the same line as a variable declaration. 3. Do not place an equation for computation on the same line as declaring a variable.

Submit the java file.

---------------------------------------------------------------

the Lab 1 Hello World assignment to use

/********************************************************************** * Program Name: Hello World * Author: Your Name Goes Here * Date: Due date goes here * Course/Section: CSC 111-301W * Program Description: * This program will display the message "Hello World" **********************************************************************/ /************************** Compiler Directives **********************/ //Pre-Processor Declaration Section //imports import java.util.Scanner; public class HelloWorld //BEGIN Class Definition { public static void main (String[] args) //BEGIN Main Method { //Data Declaration Section Scanner scan = new Scanner(System.in); //Display message System.out.print ("Hello World!"); System.out.print (" "); } //End main }//end class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions