Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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