Question
HELP IN JAVA: Need help write a code that will search for (and list) all the people who were born in a certain month Person.java:
HELP IN JAVA: Need help write a code that will search for (and list) all the people who were born in a certain month
Person.java:
public class Person {
private String firstName; private String lastName; private String birthDate; private String phoneNumber;
public Person(String firstName, String lastName, String birthDate, String phoneNumber) { this.firstName = firstName; this.lastName = lastName; this.birthDate = birthDate; this.phoneNumber = phoneNumber; }
public String getFirstName() { return firstName; }
public void setFirstName(String firstName) { this.firstName = firstName; }
public String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }
public String getBirthDate() { return birthDate; }
public void setBirthDate(String birthDate) { this.birthDate = birthDate; }
public String getPhoneNumber() { return phoneNumber; }
public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String toString() { return firstName + " " + lastName + " " + birthDate + " " + phoneNumber; } public int compareTo(Person another) { if (this.lastName.compareTo(another.getLastName())>0) return 1; else if (this.lastName.compareTo(another.getLastName())<0) return -1; else return 0; } }
BinaryTreeNode.java:
public class BinaryTreeNode
/** * Creates a new tree node with the specified data. * * @param obj the element that will become a part of the new tree node */ BinaryTreeNode (T obj) { element = obj; left = null; right = null; }
public T getValue(){ return element; }
public T getElement() { return element; }
public void setElement(T element) { this.element = element; }
public BinaryTreeNode
public void setLeft(BinaryTreeNode
public BinaryTreeNode
public void setRight(BinaryTreeNode
}
H9.java:
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner;
public class H9 { public static void inOrder(BinaryTreeNode t) { if (t != null) { inOrder(t.getLeft()); System.out.println(t.getValue()); inOrder(t.getRight());
} } private static String lookup(BinaryTreeNode
Need help writing the case 5 code only that will get the info of all the people who were born in the same given month
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started