Answer to Question #250207 in Java | JSP | JSF for Jeigh

Question #250207

1.In solving the given problem above, implement the algorithm you have written in

Activity Sheet 01 using Java as the programming language.


2. In writing your program, create methods to implement the operations identified

in the previous activity. Also, add a constructor that will display a greeting to the

user of the system.


Continuation of this:

https://www.assignmentexpert.com/homework-answers/programming-and-computer-science/algorithms/question-246742


1
Expert's answer
2021-10-13T00:29:57-0400
import java.util.Scanner;
public class Main {
  String x;  
  public Main() {//constructor
    x = "Hello "; 
  }


  public static void main(String[] args) {
    System.out.print("Enter you name: ");
    Scanner input=new Scanner(System.in);
    String name=input.next();
    Main myObj = new Main();
    System.out.println(myObj.x+name);
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS