Identify instance variables their types and access modifiers


Assignment

For representing an author, there is some information we want to track: their name, email, and date of birth. We'll have a lot of authors in the system. An author's name and email should be able to change, but their date of birth should not. Furthermore, the Author class should be able to share (with any code that has access to an Author instance) this information about that author, as well as the ability to update the appropriate information. The author must have a name and a date of birth, but doesn't have to have an email address. If some other code wants to display information about the author, the author instance should be able to provide a String that looks like this:

"Cay Horstmann ([email protected]), born 6/16/1959"

Or, for authors who have no email address, it should look like this:

"Ada Lovelace (no email), born 12/10/1815"

From this description, provide a class, Author.java, which models an author.

Identify the three instance variables, their types and access modifiers, and the methods that should be included in Author. Notice that we don't want authors to be able to "do" anything, like write books.

For this assignment, ensure that information about an Author can only be retrieved via methods, not via its instance variables directly. Remember to override toString() for getting the complete information String about an Author.

As you creating Author.java, also provide a class TestAuthor.java, which contains only a main method.

In this main method, create instances of the Author and try out all the functionality on them. The purpose of this process is for you to convince yourself that the Author works like you think it should.

Alongside each test with some output, you must include either a comment or console printout accompanying it to show what the expected output is.

Write enough testing to convince yourself it works beyond any reasonable doubt.

But we'll hint that your tests should include answering (for yourself) the following questions, in addition to the obvious ones:

Can I create multiple Authors?

If I create multiple Authors, are they and their information distinct? Would change some information on one Author change information on another?

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Identify instance variables their types and access modifiers
Reference No:- TGS03264421

Expected delivery within 24 Hours