Skip to content

OOPs Concepts (SEM 3) - Constructor, command line argument, inheritance, Generic program, exception handling, templates, file handling, Strategy Design pattern

Notifications You must be signed in to change notification settings

shinchancode/Object-Oriented-Programming-Lab

Repository files navigation

❕ Object-Oriented-Programming-Lab ❕

This is a repository for Object-Oriented-Programming-Lab assignments in Second year Information Technology of SPPU!
Do star ⭐ this Repository if you feel it helped & drop a follow!

💙 Happy Learning 💙

Language - Java

Output images are provided in particular assignment's directory

OOPs Concepts (SEM 3) - Constructor, commond line argument, inheritance, Generic program, exception handling, templates, file handling, Strategy Design pattern

[0] Design a class ‘Complex ‘with data members for real and imaginary part. Provide default and Parameterized constructors. Write a program to perform all arithmetic operations of two complex numbers.

[1] Write a Java code to perform addition of two complex numbers using a concept of command line arguments .

[2] Identify commonalities and differences between Publication, Book and Magazine classes. Title, Price, Copies are common instance variables and saleCopy is common method. The differences are, Bookclass has author and orderCopies(). Magazine Class has methods orderQty, Current issue, receiveissue().Write a program to find how many copies of the given books are ordered and display total sale of publication.

[3] Design and develop inheritance for a given case study, identify objects and relationships and implement inheritance wherever applicable. Employee class hasEmp_name, Emp_id, Address, Mail_id, and Mobile_noas members. Inherit the classes: Programmer, Team Lead, Assistant Project Manager and Project Manager from employee class. Add Basic Pay (BP) as the member of all the inherited classes with 97% of BP as DA, 10 % of BP as HRA, 12% of BP as PF, 0.1% of BP for staff club fund. Generate pay slips for the employees with their gross and net salary.

[4] Design a base class shape with two double type values and member functions to input the data and compute_area() for calculating area of shape. Derive two classes: triangle and rectangle. Make compute_area() as abstract function and redefine this function in the derived class to suit their requirements. Write a program that accepts dimensions of triangle/rectangle and display calculated area. Implement dynamic binding for given case study.

[5] Design and develop a context for given case study and implement an interface for Vehicles Consider the example of vehicles like bicycle, car and bike. All Vehicles have common functionalities such as Gear Change, Speed up and apply breaks. Make an interface and put all these common functionalities. Bicycle, Bike, Car classes should be implemented for all these functionalities in their own class in their own way.

[6] Implement a program to handle Arithmetic exception, Array Index Out of Bounds. The user enters two numbers Num1 and Num2. The division of Num1 and Num2 is displayed. If Num1 and Num2 are not integers, the program would throw a Number Format Exception. If Num2 were zero, the program would throw an Arithmetic Exception. Display the exception.

[7] Implement a generic program using any collection class to count the number of elements in a collection that have a specific property such as even numbers, odd number, prime number and palindromes.

[8] Implement a program for maintaining a database of student records using Files.Student has Student_id,name, Roll_no, Class, marks and address. Display the data for few students.

1. Create Database

2. Display Database

3. Delete Records

4. Update Record

5. Search Record

[9] Using concepts of Object-Oriented programming develop solution for any one application

Banking system having following operations :

1. Create an account

2. Deposit money

3. Withdraw money

4. Honor daily withdrawal limit

5. Check the balance

6. Display Account information.

[10] Implement Factory design pattern for the given context. Consider Car building process, which requires many steps from allocating accessories to final makeup. These steps should be written as methods and should be called while creating an instance of a specific car type. Hatchback, Sedan, SUV could be the subclasses of Car class. Car class and its subclasses, CarFactory and Test Factory Pattern should be implemented.

[11] Implement and apply Strategy Design pattern for simple Shopping Cart where three payment strategies are used such as Credit Card, PayPal, Bit Coin. Create an interface for strategy pattern and give concrete implementation for payment.

Connect with me:

codeSTACKr.com codeSTACKr | Twitter codeSTACKr | LinkedIn codeSTACKr | Instagram


About

OOPs Concepts (SEM 3) - Constructor, command line argument, inheritance, Generic program, exception handling, templates, file handling, Strategy Design pattern

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages