Question: 2. a) Draw a UML class diagram and create a class named of ldentification. The class contains Three private instance variables: name (string), e-mail (string)

 2. a) Draw a UML class diagram and create a class

2. a) Draw a UML class diagram and create a class named of ldentification. The class contains Three private instance variables: name (string), e-mail (string) and gender (char of either m' or 'f'). . One constructor to initialize the name, e-mail and gender with the given values. . Methods getters/setters: getName), getEmail, setEmail() and getGender A toString() method that returns "name(gender) at email", eg. "Nondayu (f) at ayu@upm.edu.my" Construct a program named Testldentification that demonstrates that each method works correctly. Try changing the emai of the person e.g. "Noridayu (f) at b) Relationship among classes. From class ldentification in 2a) Now construct a Book i. Four private member variables: name (String), author (an instance of the Identification noridayu@fsktm.upm.edu.my" Print all the data fields in the ldentification. class that contain the following members: class), price (double), and qty (int). The public getters and setters. getName(), getAuthor(), getPrice(), setPrice, getQty and setQty(). ii, ili A toString() that returns "book-name by author-name (gender) at email with price' You could reuse the ldentification's toString() method, which returns "author-name (gender) at email". Write a complete test program named TestBook to display two different book

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!