0% found this document useful (0 votes)
15 views

OOP Assignment Questions-AIML 16.7.24

It is based on research Oriented documents

Uploaded by

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

OOP Assignment Questions-AIML 16.7.24

It is based on research Oriented documents

Uploaded by

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

DEPARTMENT OF COMPUTER SCIENCE AND ENGIEERING

(Artificial Intelligence and Machine Learning)

Academic Year 2024-2025(Odd)

ASSIGNMENT QUESTIONS

Course Code & Name: CS3391& Object Oriented Programming

Each Group consists of 5 members

Grou Assignment 1 Assignment 2


p No (Seminar) (Handwritten)
1. Command line 1. Create a Java program to demonstrate method
arguments overloading with a mixture of data types and
2. Method overriding parameter counts
3. Super class 2. Write a Java program to demonstrate method
4. Subclass overloading with changing the number of parameters
5. Purpose of Super and data types.
keyword 3. Create a Java program to demonstrate method
1
overloading with different data types, varargs, and
changing order of parameters.
4. Write a Java program to demonstrate method
overloading with primitive data types and their
wrappers
5. Compare method overloading with method overriding.

2 1. Comparison of 1. Write a Java program to create a class called Animal


super and this with a method called makeSound(). Create a subclass
2. Data hiding in called Cat that overrides the makeSound() method to
encapsulation bark.
3. Comparison of 2. Create a Java program to demonstrate method
encapsulation overloading with method ambiguity and resolution
And abstraction using casting
4. Benefits of 3. Write a Java program to create a class known as
encapsulation Person with methods called getFirstName() and
5. Operations getLastName(). Create a subclass called Employee that
performed on adds a new method named getEmployeeId() and
arrays overrides the getLastName() method to include the
employee's job title.

1
4. Write a Java program to create a class called Shape
with methods called getPerimeter() and getArea().
Create a subclass called Circle that overrides the
getPerimeter() and getArea() methods to calculate the
area and perimeter of a circle.
5. What is Inheritance ? Explain its hierarchy.

1. length and 1. Write a Java program to demonstrate method


length() in java overloading with methods having varargs of different
2. JVM, JDK and types
JRE 2. Write a Java program to Implement multilevel
3. Components of inheritance.
Java Program 3. Write a Java program to Override a base class method
3
4. Comparison of into a derived class
method 4. Write a Java program to Create an Student class by
overloading and inheriting Person class
method overriding 5. What is the purpose of using inheritance in Java?
5. Final Keyword Jusitfy.

1. Rules for naming 1. Write a Java program to show that an abstract class
variables can contain concrete methods along with abstract
2. Local and Instance methods
variable 2. Write a Java program to show that an abstract class
3. Conversion of one can contain concrete methods along with abstract
4 data type to methods
another data type 3. Write a Java program to demonstrate an abstract class
4. Variable having variables and methods.
shadowing 4. Create a Java program to demonstrate multiple levels
5. Comparison of of inheritance with abstract classes
while and do while 5. Write the advantages of abstract classes.
5 1. Modularity 1. How do you define methods in an interface?
2. Reusability 2. Write a Java program to create an interface Sortable
3. Significance of with a method sort() that sorts an array of integers in
protected access in ascending order. Create two classes BubbleSort and
inheritance SelectionSort that implement the Sortable interface
4. Usage of access and provide their own implementations of the sort()
specifiers in method.
object oriented 3. Write a Java program to create an interface Playable
programming with a method play() that takes no arguments and
Features of returns void. Create three classes Football, Volleyball,
encapsulation and Basketball that implement the Playable interface
5. Applications of and override the play() method to play the respective
OOP sports.
4. Write a Java program to create an interface Searchable
with a method search(String keyword) that searches
for a given keyword in a text document. Create two
classes Document and WebPage that implement the
2
Searchable interface and provide their own
implementations of the search() method
5. Write a Java program to create an interface Sortable
with a method sort (int[] array) that sorts an array of
integers in descending order. Create two classes
QuickSort and MergeSort that implement the Sortable
interface and provide their own implementations of the
sort() method.

1. Implementation 1. Write a Java program to create a class called Person


procedure of with private instance variables name, age. and country.
encapsulation Provide public getter and setter methods to access and
2. Access method modify these variables.
3. Mutator method 2. Write a Java program to create a class called
4. Is- A relationship BankAccount with private instance variables
5. Implementation of accountNumber and balance. Provide public getter and
Multiple setter methods to access and modify these variables.
inheritance in Java 3. Write a Java program to create a class called Rectangle
with private instance variables length and width.
Provide public getter and setter methods to access and
6
modify these variables.
4. Write a Java program to create a class called Car with
private instance variables company_name,
model_name, year, and mileage. Provide public getter
and setter methods to access and modify the
company_name, model_name, and year variables.
However, only provide a getter method for the mileage
variable.
5. Explain how the encapsulation can be achieved in
Java.

1. Destructors 1. Write a Java program that throws an exception and


2. Advantages of catch it using a try-catch block.
Constructor 2. Write a Java program to create a method that takes an
overloading integer as a parameter and throws an exception if the
3. Need of number is odd.
constructor 3. Write a Java program to create a method that reads a
chaining file and throws an exception if the file is not found.
7 4. Comparison of C+ 4. Write a Java program that reads a list of numbers from
+ and JAVA a file and throws an exception if any of the numbers
5. Packages are positive.
5. Discuss the types of exceptions in detail.

8 1. Advantages of 1. Write a Java program to create a class called


3
OOP "Employee" with a name, salary, and hire date
2. Java compilation attributes, and a method to calculate years of service.
steps 2. Write a Java program to create a class called "Student"
3. Java String Pool with a name, grade, and courses attributes, and
4. Advantages of methods to add and remove courses.
packages 3. Write a Java program to create a class called "Library"
5. Types of packages with a collection of books and methods to add and
remove books
4. Write a Java program to create a class called
"Airplane" with a flight number, destination, and
departure time attributes, and methods to check flight
status and delay.
5. Write a Java program to create a class called
"Inventory" with a collection of products and methods
to add and remove products, and to check for low
inventory.

1. Polymorphism 1. Write a Java program to copy an array by iterating the


2. Abstraction array.
3. Inheritance 2. Write a Java program to find the maximum and
4. Encapsulation minimum value of an array.
5. Java Buzzwords 3. Write a Java program to find duplicate values in an
9
array of integer values.
4. Write a Java program to find common elements
between two integer arrays.
5. Write a Java program to find the second smallest
element in an array.
1. Java Primitive 1. Write a Java program that accepts four integers from the
Data Types user and prints equal if all four are equal, and not equal
2. Derives Types otherwise.
3. Variables 2. Write a Java program that accepts two double variables
4. Types of variables and test if both strictly between 0 and 1 and false
5. Creation of one otherwise.
dimensional array 3. Write a Java program that takes a number from the user
10 and generates an integer between 1 and 7. It displays the
weekday name.
4. Write a Java program that reads two floating-point
numbers and tests whether they are the same up to three
decimal places.
5. Write a Java program to display the multiplication table
of a given integer.

11 1. Comparison of 1. Write a Java program to demonstrate method


constructor and overloading with multiple parameters of the same data
method type.
2. Purpose of “this” 2. Create a Java program to demonstrate method
4
keyword overloading with different parameter types and variable
3. Instance Variable arguments
Hiding: 3. Create a Java program to demonstrate method
4. Constructor overloading with multiple methods having the same
overloading name but different parameter counts
5. Constructor 4. Write a Java program to demonstrate method
Chaining overloading with different parameter types and their
subclasses
5. In a class, one method has two overloaded forms. One
form is defined as static and another form is defined as
non-static. Is that method properly overloaded?
1. Scope of Default 1. Write a Java program to create a class called "School"
specifier with attributes for students, teachers, and classes, and
2. Static members methods to add and remove students and teachers, and to
3. JavaDoc create classes.
Comments 2. Write a Java program to create a class called
4. Types of "MusicLibrary" with a collection of songs and methods to
Comments add and remove songs, and to play a random song.
5. Constants 3. Write a Java program to create a class called "Shape"
12 with abstract methods for calculating area and perimeter,
and subclasses for "Rectangle", "Circle", and "Triangle".
4. Write a Java program to create a class called "Movie"
with attributes for title, director, actors, and reviews, and
methods for adding and retrieving reviews.
5. Write a Java program to create a class called
"Restaurant" with attributes for menu items, prices, and
ratings, and methods to add and remove items, and to
calculate average rating.

Prepared by Approved by
Dr.S.J.Subhashini Dr.C.Callins Christiyana
Asso.Prof /CSE Prof & HoD /CSE

You might also like