Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

4. I would encourage the use of uniform procedures.

Answered: 1 week ago

Question

10. What is meant by a feed rate?

Answered: 1 week ago