Write a driver (test) program that demonstrates each method, with at least one true and one false case for each of the methods tested.
Add methods to the Person class from Self-Test Question 16 to perform the following tasks:
• Set the name attribute of a Person object.
• Set the age attribute of a Person object.
• Test whether two Person objects are equal (have the same name and age).
• Test whether two Person objects have the same name.
• Test whether two Person objects are the same age.
• Test whether one Person object is older than another.
• Test whether one Person object is younger than another.
This project requires seven new methods to be added to Person class, but most of them are very simple to code. The test program, however, requires significant work to create test cases that cover the various decision paths of the class’s methods. Note that the equalsIgnoreCase method of the String class is used to check for matching names.
See the code in PersonImproved.java and PersonImprovedTest.java.
You might also like to view...
A variable's __________ is the part of the program that has access to the variable.
a. data type b. value c. scope d. assignment e. None of these
Forensics work requires a broad range of capabilities, many of which are typically found in conjunction with each other.
Answer the following statement true (T) or false (F)
Define a function named average_grade. This function returns a double and has four double arguments, test1, test2, test3, test4. The return value should be the average, or arithmetic mean of the four arguments. Be sure to include a comment that tells briefly what the function does.
What will be an ideal response?
Chart1 is the default name on the sheet tab for the first Chart moved to its own chart sheet
Indicate whether the statement is true or false