Question: Can someone please help with what im doing wrong in my code for java? the question is use javadoc to generate HTML documentation for the

Can someone please help with what im doing wrong in my code for java?

the question is use javadoc to generate HTML documentation for the code display 5.19 Use @author and @version tag for description of entire class Add a comment for every public method or constructor using the @param and @return tags when appropriate.

package chap4and5;

import java.util.Date;

/** * * @author coleen */ public class Person { private String name; private Date born; private Date died;//null indicates still alive { System.out.println("ITMP 2650 Java Programming summer 2017"); System.out.println("author: Coleen Feador"); System.out.println("Assignment: Chapter 5 question 9"); } public Person(String initialName,Date birthDate, Date deathDate, born, died) { if(consistent(birthDate, deathDate)) { name = initialName; born = new Date(birthDate); if(deathDate == null) died = null; else died = new Date(deathDate); } else { System.out.println("Inconsistent dates. aborting"); System.exit(0); } } public Person(Person original) { if(original==null) { System.out.println("Fatal error"); System.exit(0); } name = original.name; born = new Date(original.born); if(original.died == null) died = null; else died = new Date(original.died); } public void set(String newName, Date birthDate, Date deathDate) { if(consistent(birthDate,deathDate)) { name = newName; born = new Date(birthDate); if(deathDate == null) died = null; else died = new Date(deathDate); } else { System.out.println("inconsistent dates. aborting."); System.exit(0); } } public String toString() { String diedString; if(died == null) diedString="";//empty string else diedString = died.toString(); return (name+","+born+"-"+diedString); } public boolean equals(Person otherPerson) { if(otherPerson == null) return false; else return(name.equals(otherPerson.name) &&born.equals(otherPerson.born) && datesMatch(died, otherPerson.died)); } private static boolean datesMatch(Date date1, Date date2) { if(date1 == null) return(date2 == null); else if(date2 == null)//&& date1 !=null return false; else // both dates are not null return(date1.equals(date2)); } public void setBirthDate(Date newDate) { if(consistent(newDate, died)) born = new Date(newDate); else { System.out.println("inconsistentdates. aborting"); System.exit(0); } } public void setDeathDate(Date newDate) { if(!consistent(born, newDate)) { System.out.println("inconsistent dates. aborting"); System.exit(0); } if(newDate == null) died = null; else died = new Date(newDate); } public void setName(String newName) { name = newName; } public void setBirthYear(int newYear) { if (born == null) { System.out.println("fata;Error.Aborting"); System.exit(0); } born.setYear(newYear); if(!consistent(born, died)) { System.out.println("inconsistent dates. Aborting"); System.exit(0); } } public void setDeathYear(int newYear) { if (died == null) { System.out.println("fata; Error.aboring"); System.exit(0); } died.setYear(newYear); if(!consistent(born, died)) { System.out.println("inconsistent dates. aborting"); System.exit(0); } } Public String getName() { return name; } Public Date Person() { return new Date(born); } public Date getDeathDate() { if(died == null) return null; else return new Date(died); }

private static boolean consistent(Date birthDate, Date deathDate) { if (birthDate == null) return false; else if (deathDate == null) return true; else return(birthDate.precedes(deathDate)|| birthDate.equals(deathDate)); }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Lets work through the task of using Javadoc to generate HTML documentation for your Java class Below I will guide you step by step and correct some formatting issues in your code as well as ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!