Ime: 3 Hours Max. Marks 100: QP. Code
Ime: 3 Hours Max. Marks 100: QP. Code
Ime: 3 Hours Max. Marks 100: QP. Code
CODE
B.E / B.Tech. LABORATORY EXAMINATIONS, OCTOBER /
NOVEMBER 2018
Third Semester
Computer Science and Engineering
CS8383 - Object Oriented Programming Laboratory
(Common to IT, EIE & ICE)
(Regulations - 2017)
Time : 3 Hours Max. Marks 100
1. 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, type of EB
connection (i.e domestic or commercial). Compute the bill amount using the following tariff.
If the type of the EB connection is domestic, calculate the amount to be paid as follows:
If the type of the EB connection is commercial, calculate the amount to be paid as follows:
i) Write a java program to find whether the number is odd or even numbers in an array.
2. ii) Write a java program to check whether the given string is a palindrome.
3. Write a java program using package to find the number is Armstrong number
4. 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.
5. Write a java program to perform the following functions using classes, objects, constructors and
destructors where essential.
7. Write an exception class for a time of day that can accept only 24 hour representation of clock
hours. Write a java program to input various formats of timings and throw suitable error
messages.
9. 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.
Write a program to perform string operations using ArrayList. Write functions for the following
10.
a. Append – add at end
b. Insert – add at particular index
c. Search
d. List all string starts with given letter
11. i) Write a java program that arranges the given set of strings in alphabetical order. Supply the
strings through command line.
ii) Write a java program that print the string in reverse order.
12. Design a Java interface for ADT Stack. Implement this interface using array. Provide
necessary exception handling in both the implementations.
13. 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.
14. Write a Java program to toggle the background color on every click of button.
15. Write a java program to find the maximum value from the given type of elements using a
generic function.
16. Write a program to perform the following operations on an array using generic classes
i) Add an element in the beginning/middle/end
ii) Delete an element from a given position
17. 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.
18. Design a calculator using event-driven programming paradigm of Java with the following
options.
a) Decimal manipulations
b) Scientific manipulations
19. Write a program to create interface method named customer. In this keep the methods called
information(),show() and also maintain the tax rate. Implement this interface in employee class
and calculate the tax of the employee based on their income.
Male Female