Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 5. The Author and Book Classes (for a Bookstore) This task has two parts, at first write class Author, after that write class Book.
Task 5. The Author and Book Classes (for a Bookstore) This task has two parts, at first write class Author, after that write class Book. Contain a '@'. Author -name:string -email:string -gender:char +Author(name:string, email:string, gender:char) +getName(): string +getEmail():string +setEmail (email:string):void +getGender():char +print():void 'm', 'f', or 'u' for unknown "name (gender) at email Write a class Author, designed as shown in the class diagram. It contains: 1. Three private data members: name (string), email (string), and gender (char of'm', 'f or 'u' for unknown). 2. A constructor to initialize the name, email and gender with the given values. There are no default values for data members. 3. Getters for name, email and gender, and setter for email. There is no setter for name and gender as we assume that these attributes cannot be changed. 4. A print() member function that prints "name (gender) at email", e... "Peter Jones (m) at peter @somewhere.com
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