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

Oop1 CLM LT 3

This document provides details for an object oriented programming lab task to develop classes for books. It includes class definitions for StoryBook and TextBook with attributes like ISBN, title, author, price and methods like getters, setters, changing quantity and displaying details. Students are instructed to create objects of each class and use all the methods and constructors to demonstrate how the classes work.

Uploaded by

Abrar Prince
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)
50 views2 pages

Oop1 CLM LT 3

This document provides details for an object oriented programming lab task to develop classes for books. It includes class definitions for StoryBook and TextBook with attributes like ISBN, title, author, price and methods like getters, setters, changing quantity and displaying details. Students are instructed to create objects of each class and use all the methods and constructors to demonstrate how the classes work.

Uploaded by

Abrar Prince
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)

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