Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I couldn't solve part J. Please help me. It's for java netbanes The following class UML is used to write a program for a Book

I couldn't solve part J. Please help me. It's for java netbanes image text in transcribed
The following class UML is used to write a program for a Book Store system. Study the UML then answer the questions: a. Write the definition of the class "Author" with its member variables and methods. b. Write the definition of the class "Book", and create a constructor that initializes the string variables to empty while the remaining attributes default to zero Also the constructor shall increase the quantity by one. c. Create a constructor for Book that sets all the book attributes (name, isbn, author, and price). Also the constructor shall increase the quantity by one. d. Write the method setTitle() to fill the book title. e. Write the method getTitle() to return the book title. f. Write the method setAuthor() to fill the book author. g. Write the method getAuthor() to return the book author. h. Write a method getQty(). This method shall return the quantity value. i. Write a method displayBook(). This method shall print in a nice format the following data: title, isbn, author, price, quantity). j. Write a main program to test your classes: a) Declares two objects of type Book and set the data of the objects to some new data to be read from the keyboard. b) Call the method getQty() to print the quantity all book objects. c) Print the information of the 2nd object then the 1st object. d) Print the total cost of all books objects created in (a)

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions