0% found this document useful (0 votes)
53 views2 pages

Task 1

The document outlines a lab task for the course CSC1205: Object Oriented Programming 1 (JAVA) at American International University-Bangladesh. It requires students to develop a basic Java program implementing inheritance, association, and polymorphism based on a provided class diagram involving Book, StoryBook, TextBook, and BookShop classes. Students must create instances of these classes and demonstrate their methods and constructors in the main method of the Start class.

Uploaded by

sabujp514
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

Task 1

The document outlines a lab task for the course CSC1205: Object Oriented Programming 1 (JAVA) at American International University-Bangladesh. It requires students to develop a basic Java program implementing inheritance, association, and polymorphism based on a provided class diagram involving Book, StoryBook, TextBook, and BookShop classes. Students must create instances of these classes and demonstrate their methods and constructors in the main method of the Start class.

Uploaded by

sabujp514
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

You might also like