You are on page 1of 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)

Developing basic Java classes with attributes, constructors, methods, static variables
Lab Task – 3 :
and static methods.

Look at the following class notations carefully, and develop the program.
American International University-Bangladesh (AIUB)

StoryBook

String isbn
String bookTitle
String authorName
double price
int availableQuantity
String category
static double discountRate
StoryBook( )
StoryBook(String isbn, String bookTitle, String authorName, double price, int availableQuantity,
String category)

static void setDiscountRate(double rate)


static double getDiscountRate( )

void setIsbn(String isbn)


void setBookTitle(String bookTitle)
void setAuthorName(String authorName)
void setPrice(double price)
void setAvaiableQuantity(int availableQuantity)
void setCategory(String category)
String getIsbn( )
String getBookTitle( )
String getAuthorName( )
double getPrice( )
int getAvailableQuantity( )
String getCategory( )
void addQuantity(int amount)
void sellQuantity(int amount)
void showDetails( )
TextBook
String isbn
String bookTitle
String authorName
double price
int availableQuantity
int standard
static double discountRate
TextBook( )
TextBook(String isbn, String bookTitle, String authorName, double price, int availableQuantity,
int standard)
static void setDiscountRate(double rate)
American International University-Bangladesh (AIUB)

static double getDiscountRate( )

void setIsbn(String isbn)


void setBookTitle(String bookTitle)
void setAuthorName(String authorName)
void setPrice(double price)
void setAvaiableQuantity(int availableQuantity)
void setStandard(int standard)
String getIsbn( )
String getBookTitle( )
String getAuthorName( )
double getPrice( )
int getAvailableQuantity( )
int getStandard( )
void addQuantity(int amount)
void sellQuantity(int amount)
void showDetails( )

Start

The Start class contains the main method. Inside the main method, create two objects of
StoryBook and two objects of TextBook. Demonstrate all the methods and constructors.

You might also like