The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
The purpose of this assignment is use method-chaining and write by specification in OOP.
I have a some of it done but i'm getting the wrong output every time,
Below is the what i have done, and attached is what it need to look like.
public class ComputerMicrobe
{
public String name; // Instance variable for name of the Computer Microbe
public String dNACode; // Instance variable to hold the number of Computer Microbe
private String reverse;
@Override
public String toString()
{
return name; //ToString so as to ignore hashvalues result in output
}
public ComputerMicrobe(String name, String dNACode)
{
this.setName(name); //set name
this.setDNACode(dNACode); //set dNACode
}
public void setName(String name)
{
this.name = name;
}
public void setDNACode(String dNACode)
{
this.dNACode = dNACode;
}
public ComputerMicrobe reverse()
{
String reverse = new StringBuffer(dNACode).
reverse().toString();
System.out.println(reverse); //reverse output
return this;
}
ComputerMicrobe reproduce(ComputerMicrobe b)
{
return null;
}
void mutate(ComputerMicrobe a)
{
}
}
Â
You must create two Java files. One is called LastNameFirstNameWeek7Prog.java, andthe other is called  ComputerMicrobe.java.Ensure you include ALL the java files required to make your program compile and run. I would like to see your .java files only.)Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter. Only submit the .java files needed to make the program run. Do not submit the .class file or any other file. 5%Style ComponentsInclude properly formatted prologue, comments, indenting, and other styleelements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.5%LastNameFirstNameWeek7Prog.javaWrite a driver class that uses the ComputerMicrobe class. This driver class will use the main method provided below exactly. You must copy it and not change it. Any change in the main method will incur in deducted points.public static void main (String[] args){      Scanner stdIn = new Scanner(System.in);      String name;    //Auxiliar ComputerMicrobe name      String dNACode;   //Auxiliar ComputerMicrobe DNA Code      ComputerMicrobe a, b, c; // ComputerMicrobe objects      System.out.println("Enter name of first ComputerMicrobe");      name = stdIn.next();      System.out.println("Enter DNA Code for first ComputerMicrobe");      dNACode = stdIn.next();      a = new ComputerMicrobe(name, dNACode);      System.out.println("Enter name of second ComputerMicrobe");      name = stdIn.next();      System.out.println("Enter DNA Code for second ComputerMicrobe");      dNACode = stdIn.next();      b = new ComputerMicrobe(name, dNACode);30%
Attachments:
-----------