0% found this document useful (0 votes)
10 views1 page

(OOP1) MidTerm - Task 2 - Part 1

Uploaded by

o.548473i
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)
10 views1 page

(OOP1) MidTerm - Task 2 - Part 1

Uploaded by

o.548473i
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/ 1

Object Oriented Programming 1

1. Develop the Book Class. After that Inside main method, create 4 objects and show the details of all
objects also test other methods to check if they are working properly.

String bookName Declare the properties


String bookAuthor as private. Use public
String bookId getter and setter
String bookType methods to access
Book int bookCopy // number of copies of the book
2 Constructor Empty and Parameterized
void showDetails()
void addBookCopy(int x)// how many copy of book
static int uniqueBookCounter
static void totalNumberOfUniqueBooks() //shows the value of uniqueBookCounter

2. Develop the Contact Class. After that Inside main method, create 4 objects and show the details of all
objects also test other methods to check if they are working properly.

String personName Declare the properties


String personId as private. Use public
int age getter and setter
Contact String mobileNumber; methods to access
Char gender // M or F
2 Constructor Empty and parameterized
void showDetails()
void showOperator() // it will show GP or Robi etc.

3. Develop the Mobile Class. After that Inside main method, create 4 Mobile objects show the details of
all objects also test other methods to check if they are working properly.

String mobileOwnerName Declare the


String mobileNumber // SIM number properties as private.
double mobileBalance Use public getter and
String mobileOSName setter methods to
boolean lock // true means phone is lock, false means unlock access
Mobile
2 Constructor Empty and parameterized Lock has to be false
void showDetails() to show or recharge
void recharge(int amount) or call someone, so
float adjustAfterCall (float timeDuration, float costPerMinute) check the lock
//shows the cost and adjusted balance and returns the cost flag/Boolean variable

You might also like