AMERICAN INTERNATIONAL UNIVERSITY-BANGLADESH
(AIUB)
Faculty of Science and Technology (FST)
Department of Computer Science (CS)
Course Title : CSC1205: Object Oriented Programming 1 (JAVA)
Lab Task – 7 : Developing a basic Java program with Inheritance, Association and Polymorphism.
Look at the following class notations and class diagram carefully, and develop the program.
American International University-Bangladesh (AIUB)
StoryBook
BookShop Book
TextBook
Class Diagram
Book
String isbn
String bookTitle
String authorName
double price
int availableQuantity
Book( )
Book(String isbn, String bookTitle, String authorName, double price, int availableQuantity)
void setIsbn(String isbn)
void setBookTitle(String bookTitle)
void setAuthorName(String authorName)
void setPrice(double price)
void setAvaiableQuantity(int availableQuantity)
String getIsbn( )
String getBookTitle( )
String getAuthorName( )
double getPrice( )
int getAvailableQuantity( )
void addQuantity(int amount)
void sellQuantity(int amount)
void showDetails( )
StoryBook
String category
StoryBook( )
StoryBook(String isbn, String bookTitle, String authorName, double price, int availableQuantity,
String category)
void setCategory(String category)
String getCategory( )
TextBook
American International University-Bangladesh (AIUB)
int standard
TextBook( )
TextBook(String isbn, String bookTitle, String authorName, double price, int availableQuantity,
int standard)
void setStandard(int standard)
int getStandard( )
BookShop
String name
Book books[ ] //size of array should be 100.
BookShop( )
BookShop(String name)
void setName(String name)
String getName( )
boolean insertBook(Book b)
boolean removeBook(Book b)
void showAllBooks( )
Book searchBook(String isbn)
Start
The Start class contains the main method. Inside the main method, create Five objects of
StoryBook, Five objects of TextBook and One object of BookShop. Demonstrate all the methods
and constructors.