Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

OOPS LAB MANUAL

Rating
-
Sold
-
Pages
78
Uploaded on
14-02-2025
Written in
2016/2017

Lecture notes of 78 pages for the course CS8383 at Anna University (Lab manual guide)

Institution
Course

Content preview

ST. ANNE’S
COLLEGE OF ENGINEERING AND TECHNOLOGY
ANGUCHETTYPALAYAM, PANRUTI – 607 110



DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING




LAB MANUAL




CS8383 - OBJECT ORIENTED PROGRAMMING LABORATORY


Regulation 2017




PREPARED BY

K.POORNAMBIGAI,
Asst. Professor / CSE

,CS8383 OBJECT ORIENTED PROGRAMMING LABORATORY LTPC
0 04 2
OBJECTIVES
To build software development skills using java programming for real-world
applications.
To understand and apply the concepts of classes, packages, interfaces, arraylist, exception
handling and file processing.
To develop applications using generic programming and event handling.

LIST OF EXPERIMENTS
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:
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. 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.

3. 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.

4. Design a Java interface for ADT Stack. Implement this interface using array. Provide
necessary exception handling in both the implementations.

,5. Write a program to perform string operations using ArrayList. Write functions for the
following
a. Append - add at end
b. Insert - add at particular index
c. Search
d. List all string starts with given letter

6. 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.

7. Write a Java program to implement user defined exception handling.

8. 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.

9. 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.

10. Write a java program to find the maximum value from the given type of elements using a
generic function.

11. Design a calculator using event-driven programming paradigm of Java with the following
options.
a) Decimal manipulations
b) Scientific manipulations

12. Develop a mini project for any application using Java concepts.

TOTAL : 60 PERIODS
OUTCOMES
Upon completion of the course, the students will be able to
Develop and implement Java programs for simple applications that make use of classes,
packages and interfaces.
Develop and implement Java programs with arraylist, exception handling and
multithreading.
Design applications using file processing, generic programming and event handling.

, GENERATING ELECTRICITY BILL


AIM:

To Develop a Java application to generate Electricity bill.

ALGORITHM:

1. Import the java packages.
2. Create a class with members Consumer no., consumer name, previous month reading,
current month reading, type of EB connection (i.e domestic or commercial).
3. Class also contains methods domesticbillcalc and commercialbillcalc with its parameters to
compute bill amount.
4. Check whether the type of connection is domestic or commercial.
If domestic, calculate the bill amount 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 commercial, calculate the bill amount 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
5. Calculate the units consumed by finding the differences between previous month reading
and current month reading.
6. By using Scanner class get the input during runtime.
7. Create object for a class in memory and assign it to the reference variable, then the method
is invoked.
8. Finally, the bill amount is displayed based on type of connection.

PROGRAM:

//File Name should be Saved as Ebbill.java

import java.io.*;
import java.util.*;
class ElectricityBill
{
double bill;
double domesticbillcalc (int units)
{
if(units<100)
bill = units * 1 ;

Written for

Institution
Course

Document information

Uploaded on
February 14, 2025
Number of pages
78
Written in
2016/2017
Type
Class notes
Professor(s)
Gopal
Contains
All classes

Subjects

$8.29
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
shenbagamoorthys

Get to know the seller

Seller avatar
shenbagamoorthys The kavery engineering college
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions