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

the following is my assignment : You will create a Virtual World application as

ID: 3693676 • Letter: T

Question

the following is my assignment :

You will create a Virtual World application as your final project. This Virtual World will have several objects including a MyClone object and another object of your choice. It would be an excellent idea to review the Final Project Guidelines at this time. For this Third Final Project Milestone, you will finish development of your MyClone class and create another class of your choice.

In Module Two, you started development of the MyClone class. You will continue to develop the MyClone class by adding accessor methods, mutator methoda, and an introduction() method. The introduction() method will introduce yourself to the virtual world by displaying a greeting, your first and last name, and anything else you would want to say.

You will also create another class of your choice. Your programmer-defined class should have at a minimum two instance variables and one method. The instance variables and method should be representative of the data and behavior that objects of this class will have. You will demonstrate your understanding of encapsulation by declaring the instance varibales as private and by creating accessors and mutatora for each instance variable. You should have at least one constructor created that initializes all instance variables. Document your code.

This is my Code that i cannot get to run, need help please:

package myclone;

/**
*
* @author lawrence.standley
*/
public class MyClone {
private String firstName; //Use of private specifier
private String lastName; //Use of private specifier
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
//Method of encapsulation
/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}

/**
* @param firstName the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}

/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}

/**
* @param lastName the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void introduction(){
System.out.println("Hi, "+getFirstName()+" "+getLastName()+" Here. How are you. Hope Everyone is doing great.");
}
}

public class MyCloneTest {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
MyClone obj = new MyClone("Lawernce", "Standley");
obj.introduction();
}

}

Explanation / Answer

//MyClone.java
public class MyClone
{
   private String firstName; //Use of private specifier
   private String lastName; //Use of private specifier
  
   /*Constructor to set firstName and lastName
      The constructor that takes first name and last name
      as input arguments and set to class firstName and lastName
      variables */

   public MyClone(String firstName,String lastName){
       //Call setFirstName
       setFirstName(firstName);
       //Call setLastName
       setLastName(lastName);
   }

   /**
   * @param firstName the firstName to set
   */
   public void setFirstName(String firstName){
       this.firstName = firstName;
   }
  
   /**
   * @param lastName the lastName to set
   */
   public void setLastName(String lastName) {
       this.lastName = lastName;
   }
  
   /**
   * @return the firstName
   */
   public String getFirstName(){
       return firstName;
   }

   /**
   * @return the lastName
   */
   public String getLastName(){
       return lastName;
   }
  
   public void introduction(){
       System.out.println("Hi, "+getFirstName()+" "+getLastName()+" Here. How are you. Hope Everyone is doing great.");
   }
}

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

/**
* The java program that tests the class MyClone.
* The main method instantiates MyClone class with
* two input arguments . Then call introduction method
* of MyClone class.
* */
//MyCloneTest.java
public class MyCloneTest
{
   public static void main(String[] args)
   {
       //Create an instance of MyClone class
       MyClone obj = new MyClone("Lawernce", "Standley");
       //Call introduction
       obj.introduction();

   }

}

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

Sample Output:

Hi, Lawernce Standley Here. How are you. Hope Everyone is doing great.