You are on page 1of 5

VELAMMAL COLLEGE OF ENGINEERING & TECHNOLOGY, MADURAI-625 009

DEPARTMENT OF INFORMATION TECHNOLOGY

Degree B.Tech-IT

Course Code-Title CS8392 /Object Oriented Programming

Course Component Professional Core

Name of the Instructor Mrs.N.Shanmuga Sundari

Important Programs asked in previous year question paper:

 UQP-University Question paper program


 Practical-Lab program in syllabus

1. Write a program to perform the following functions using classes, objects(Classes,Objects)-


UQP

i)Get as input of marks of 5 students in 5 subjects

ii)Calculate the total and average

iii)Print the formatted result on the screen

2. Write a JAVA program using classes to perform linear search on an array of ‘N’ numbers.
Give the explanatory comments in your program. (Classes,Objects)-UQP

3. Develop a Java application to generate Electricity bill. Create a class with the following
members: Consumer no., consumer name, previous month reading, current month reading, and
type of EB connection (i.e domestic or commercial). Compute the bill amount using the
following tariff. (Classes,Objects)-Practical

If the type of the EB connection is domestic, calculate the amount to be paid as follows:
 First 100 units - Rs. 1 per unit
 101-200 units - Rs. 2.50 per unit
 201 -500 units - Rs. 4 per unit
 > 501 units - Rs. 6 per unit
If the type of the EB connection is commercial, calculate the amount to be paid as follows:
 First 100 units - Rs. 2 per unit
 101-200 units - Rs. 4.50 per unit
 201 -500 units - Rs. 6 per unit
 > 501 units - Rs. 7 per unit
2. Write a program to perform the following functions(Basic JAVA)-UQP

i) Find the row and column sum


ii) Interchange the rows and columns
3. Given two dimensional arrays A and B sorted ascending order. Write a JAVA program to
merge them into a single sorted array. See that it contains every item from array A and B,in
ascending order. (Basic JAVA)-UQP

4. Write a JAVA program to mimics a calculator. Input two real numbers and state the type of
arithmetic operation between them through another keyboard input. (Basic JAVA)-UQP

5. Write a JAVA program to multiply two 3X3 matrices(Basic JAVA)-UQP

6. Develop a java program to maintain the books details like BookId, AccessionNumber,
BookName, Author, Publication in books package and keep the journal details such as
Journalid;JournalName;in journal package in main class use these two packages details for Staff
and Student classes and display the books and journals information as requested by the user.
(Packages)-UQP
7. Write java program for generating four threads to perform the following
operations(Threading)-UQP

i)Getting ‘N’ number as input

ii)Printing the even numbers

iii)Printing the odd numbers

iv)Computing the average

8. Write a java program that collects the input as a decimal number of integer type and converts
it into a string of equivalent hexadecimal number (Basic JAVA)-UQP

9. Write a JAVA program that arranges the given set of strings in the alphabetical order. Supply
the strings through the command line(Basic JAVA)-UQP

10. An analysis of examination results at a school gave the following distribution of grades for
all subjects taken in one year(Event Handling)-UQP

Grade Percentage
A 10
B 25
C 45
D 20
Write a JAVA program to represent the distribution of each grade in a pie chart,where each slice
of pie is differently colored

11.Write a JAVA program to plot the path of a small circle moving around the circumference of
a large circle(Event Handling)-UQP

12.Rotate a compass needle on the screen about a fixed point in response to the mouse being
moved around the screen. (Event Handling)-UQP

13.Write an exception class for a time of day that can accept only 24 hrs representation of clock
hours (example 15:35).Write a JAVA program to input various formats of timings and throw
suitable error messages. (Exception Handling)-UQP

14. Design and write a JAVA program to display the buttons from digital phone. As a number is
dialed, play the respective tone.After a six digit number is input the program should play a
ringing tone.The termination of this call should be initiated after playing this tone for 20 seconds.
(Event Handling)-UQP

15. Create a JAVA class shape with constructor to initialize the one parameter “dimension”.Now
create three sub classes of shape with following methods. (Inheritance)-UQP

i) circle with methods to calculate the area and circumferences of the circle with the dimension
as radius

ii) Square with methods to calculate the area and length of the diagonal of the square with the
dimension as length of one side

ii) sphere with methods to calculate the volume and surface area of the sphere with the
dimension as radius of the sphere.

Write appropriate main method to create object of every class and test every method.

16. Develop a Library interface which has drawbook(),returnbook()(with fine),checkstatus(),and


reservebook() methods. All the methods are tagged with public in the following ways:
(Interface)-UQP

(i) Using draw book()-get the required book based on title

(ii)Using checkstatus-user book returned date details

(iii)Using with fine()-Whether failed to return the book within a time period charge-Rs.5/day

(iv)Using reserve book()-block or reserve particular book for their account.


17.Create a simple menu application that enables a user to select one of the following items.
(Event Handling)-UQP

Radio1 ,Radio 2,Radio3,Radio4,Radio5,Red Dragon Radio

i)from the menu bar of the application

ii)from a pop up menu

iii)from a toolbar

Add tooltips to each menu item that indicates some information about the radio station such as
type of music and its broadcast frequency

18. write a program to create interface named customer. In this keep the methods called
information(),show() and also maintain in the Tax rate. Implement this interface in employee
class and calculate the tax of the employee based on their Income(Interface)-UQP
Income Tax Percentage Male Female
>=1,90,000 Nil Nil
>=2,00,000 10% Nil
>=5,00,000 20% 10%
<5,00,000 25% 20%
.

19.Write a java code to simulate the way of stack mechanism works using Exception Handling.
(Eg:Stack full msg when add new elements and stack enpty message when delete element)
(Exception Handling)-UQP

20.Write a JAVA program for inventory problem using threads(Threading)-UQP

addstock() getstock()

Producer--------------------> Stock-------------------->Consumer

notify() wait()

21. Develop a java application to implement currency converter (Dollar to INR, EURO to INR,
Yen to INR and vice versa), distance converter (meter to KM, miles to KM and vice versa) , time
converter (hours to minutes, seconds and vice versa) using packages. (Packages)-Practical
22. Develop a java application with Employee class with Emp_name, Emp_id, Address, Mail_id,
Mobile_no as members. Inherit the classes, Programmer, Assistant Professor, Associate
Professor and Professor 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.
(Inheritance)-Practical
23. Design a Java interface for ADT Stack. Implement this interface using array. Provide
necessary exception handling in both the implementations(Interface)-Practical
24. Write a program to perform string operations using Array List. Write functions for the
following (Strings)-Practical
a. Append - add at end
b. Insert – add at particular index
c. Search
d. List all string starts with given letter
25. Write a Java Program to create an abstract class named Shape that contains two integers and
an empty method named print Area(). Provide three classes named Rectangle, Triangle and
Circle such that each one of the classes extends the class Shape. Each one of the classes contains
only the method print Area () that prints the area of the given shape. (Abstract Classes)-
Practical
26. Write a Java program to implement user defined exception handling. (Exception Handling)-
Practical
27. Write a Java program that reads a file name from the user, displays information about
whether the file exists, whether the file is readable, or writable, the type of file and the length of
the file in bytes. (File Handling)-Practical
28. Write a java program that implements a multi-threaded application that has three threads.
First thread generates a random integer every 1 second and if the value is even, second thread
computes the square of the number and prints. If the value is odd, the third thread will print the
value of cube of the number. (Threading)-Practical
29. Write a java program to find the maximum value from the given type of elements using a
generic function. (Generic functions)-Practical
30. Design a calculator using event-driven programming paradigm of Java with the following
options. (Event Handling)-Practical
a) Decimal manipulations
b) Scientific manipulations
31. Define a class named COMPLEX for representing complex numbers that contains necessary
data members and member functions. A complex number has the general form a + ib, where a is
the real part and b is the imaginary part (i stands for imaginary). Include methods for all the four
basic arithmetic operators. (Classes and objects)-UQP
32. Write a Java program that determines the number of days in a month (Classes and objects)-
UQP
33. Write a program TestThreadMany.java that takes a positive integer n from the command line
and creates exactly n threads that print out their own name(Threading)-UQP
34. Write a program to find whether the string is palindrome or not and Write a java program to
concatenate and compare the two strings (String Handling)-UQP
35. i)Write a java program to plot the path of small circle moving around the circumference of a
larger circle. ii) Write a java program to draw polygon (Event Handling)-UQP
36. Write a Java application for Banking transaction. It rises user defined exception while
encountering errors during debit transaction and also solves the exception by using appropriate
handling techniques (Exception Handling)-UQP

You might also like