You are on page 1of 12

Format No. QSP/7.1/01.

F01 (B)
Issue No.04 Rev. No 4 Dated: June 7, 2014
_____________________________________________________________________________________________

UNIVERSITY OF PETROLEUM & ENERGY STUDIES


College of Engineering Studies
Dehradun
______________________________________________________

COURSE PLAN
Programme : B.Tech (CSE) MFT,CCVT,OGI,OSS,BAO,TI

Course : Java Programming Lab

Subject Code : CSEG 352

No. of credits :2

Semester : III

Session : 2014-2015

Batch : 2012-2016

Prepared by : Mr. Ajay Rawat/Mr. Hukam Singh Rana/Mr. Hitesh Sharma/Mr.

Ravi Tomar/Ajay Rawat/Dr. Inder Singh/Mr. Ankur Dumka

Email :hsrana@ddn.upes.ac.in

Approved By

_______________________ _______________________

HOD Dean
UPES Campus Tel : +91-135-2770137
Energy Acres Fax : +91 135- 27760904

P.O. Bidholi, Via Prem Nagar Website : www.upes.ac.in

COURSE PLAN
Subject: Java programming Lab Course: B.Tech (CSE)
MFT,CCVT,OGI,OSS,BAO,TI

Duration: Aug 2014-Dec 2014 Subject code: CSEG 352

One Session: 120 Minutes

A. OBJECTIVES:

(a) The overall objective of the modules is that the student should be able to distinguish
between the concepts of structural programming and object oriented programming.
(b) The student should be able to design and code the programs using java concept.
(c) The student should be able to understand the flexibility and modularity provided by OOPs
using Java.

B. COURSE OUTLINE

Sl. No. Experiment Contents

Introduction to Java Environment


1. Experiment - 1
(Installation, Classpath, Eclipse)
2. Experiment 2,3 Basic Java Programming

3. Experiment 4 Inheritance

4. Experiment 5 Interfaces

5. Experiment 6 Packages

6. Experiment 7 Exceptions

7. Experiment 8 String Handling


8. Experiment 9 Wrapper Classes

9. Experiment 10 Threads

10. Experiment 11 Files and Streams

11 Experiment 12 Collections

C. PEDAGOGY

D. COURSE COMPLETION PLAN

E. EVALUATION & GRADING

Description Weight age Schedule

1. Internal Examination 50% Detailed Below

2. End-term Exam 50% Academic Calendar

Internal Assessment shall be based on the following

Sl. No. Description % of Weightage out of 50%

1 Continuous Assessment 20

2 Viva-Voce/Quiz 20

3 General Discipline 10

Internal Assessment Record Sheet will be displayed on ICOS at the end of the semester i.e.
in the last week of regular classroom teaching.

CONTINUOUS ASSESSMENT: Based on the weekly evaluation of the experiments actually


performed by the students in the Laboratory and submitted on the same day or on the very
next turn.
The continuous Assessment will be displayed on ICOS on monthly basis i.e. on the last
two or three working days of every month.

MANDATARY: Min. 10 experiments to be performed by each student.

VIVA-VOCE/QUIZ: Two Viva-Voce examinations will be held; one after completion of


atleast three experiments by each student/three turns of Laboratory Class and second
after completion of atleast six experiments by each student/six turns of Laboratory
Class. In addition to the Viva-Voce Examination, a Quiz examination based on
objective type questions will be held after completion of atleast nine experiments by
each student/nine turns of laboratory class. Those who do not appear in Viva-Voce
and quiz examinations shall lose their marks.

The marks obtained by the students will be displayed on ICOS after evaluation.

GENERAL DISCIPLINE: Based on students regularity, punctuality, sincerity and


behaviour in the class.

End -Sem Examination: 50% Weightage

End Term Examination shall be Three Hours duration and shall be conducted by actually
performing the experiment.
F. DETAILED SESSION PLAN

EXPERIMENT 1

TITLE: Introduction to Java Environment

1) Installation of JDK
2) Setting of path and classpath
3) Introduction to Eclipse

EXPERIMENT 2,3

TITLE: Basic Java Programming

1) Write a program to find the largest of 3 numbers.


2) Write a program to add two number using command line arguments.
3) Write a program to print Fibonacci series using loop.
4) Write a program to that implement command line calculator.
5) Write a program using classes and object in java.
6) Write a program to accept 10 students marks in an array, arrange it into ascending 10 order,
convert into the following grades and print marks and grades in the tabular form.
Between 40 and 50 : PASS

Between 51 and 75 : MERIT

and above : DISTINCTION

7) Write a program to accept three digits (i.e. 0 - 9) and print all its possible combinations. 10
(For example if the three digits are 1, 2, 3 than all possible combinations are : 123, 132,

213, 231, 312, 321.)

8) Write a Java Program to accept 10 numbers in an array and compute the sum of the 10
square of these numbers.

9) Write a program to input a number of a month (1 - 12) and print its equivalent name of 10
the month.( e.g 1 to Jan, 2 to Feb. 12 to Dec.)
10) Write a program to find the number of and sum of all integers greater than 40 and less 10than
250 that are divisible by 5.

EXPERIMENT 4

TITLE Inheritance

1) Write a Java program to show that private member of a super class cannot be accessed from
derived classes.

2) Write a program in Java to create a Player class. Inherit the classes Cricket _Player, Football
_Player and Hockey_ Player from Player class.

3) Write a class Worker and derive classes DailyWorker and SalariedWorker from it. Every worker
has a name and a salary rate. Write method ComPay (int hours) to compute the week pay of
every worker. A Daily Worker is paid on the basis of the number of days s/he works. The Salaried
Worker gets paid the wage for 40 hours a week no matter what the actual hours are. Test this
program to calculate the pay of workers. You are expected to use the concept of polymorphism
to write this program.

4) Consider the trunk calls of a telephone exchange. A trunk call can be ordinary, urgent or
lightning. The charges depend on the duration and the type of the call. Write a program using the
concept of polymorphism in Java to calculate the charges.

5) Design a class employee of an organisation. An employee has a name, empid, and salary. Write
the default constructor, a constructor with parameters (name, empid, and salary) and methods
to return name and salary. Also write a method increasesalary that raises the employees salary
by a certain user specified percentage. Derive a subclass Manager from employee. Add an
instance variable named department to the manager class. Supply a test program that uses
theses classes and methods.
EXPERIMENT 5

TITLE: Interface

1) Write a program to create interface named test. In this interface the member function is square.
Implement this interface in arithmetic class. Create one new class called ToTestInt in this class
use the object of arithmetic class

2) Write a program to create interface A in this interface we have two method meth1 and meth2.
Implements this interface in another class named MyClass.

3) Write a program in Java to show the usefulness of Interfaces as a place to keep constant value of
the program

4) Write a program to create an Interface having two methods division and modules. Create a class,
which overrides these methods.

EXPERIMENT 6

TITLE: Package

1) Write a Java program to implement the concept of importing classes from user defined package
and creating packages.

2) Write a program to make a package Balance in which has Account class with Display_Balance
method in it. Import Balance package in another program to access Display_Balance method of
Account class.
EXPERIMENT 7

TITLE: Exception

1) Write a program in Java to display the names and roll numbers of students. Initialize respective
array variables for 10 students. Handle ArrayIndexOutOfBoundsExeption, so that any such
problem doesnt cause illegal termination of program.

2) Write a Java program to enable the user to handle any chance of divide by zero exception.

3) Create an exception class, which throws an exception if operand is nonnumeric in calculating


modules. (Use command line arguments).

4) On a single track two vehicles are running. As vehicles are going in same direction there is no
problem. If the vehicles are running in different direction there is a chance of collision. To avoid
collisions write a Java program using exception handling. You are free to make necessary
assumptions.

5) Write a java program to throw a exception (checked) for an employee details.


If an employee name is a number, a name exception must be thrown.
If an employee age is greater than 50, an age exception must be thrown.
Or else an object must be created for the entered employee details
EXPERIMENT 8

TITLE: Strings Handling

1) Write a program for searching strings for the first occurrence of a character or substring and for
the last occurrence of a character or substring.

2) Write a program that converts all characters of a string in capital letters. (Use StringBuffer to
store a string). Dont use inbuilt function.

3) Write a program in Java to read a statement from console, convert it into upper case and again
print on console. (Dont use inbuilt function)

4) Write a program in Java to create a String object. Initialize this object with your name. Find the
length of your name using the appropriate String method. Find whether the character a is in
your name or not; if yes find the number of times a appears in your name. Print locations of
occurrences of a .Try the same for different String objects

EXPERIMENT 9

TITLE: Wrapper Classes

1) Write a Java code that converts int to Integer converts Integer to String converts String to int
converts int to String converts String to Integer converts Integer to int.

2) Write a Java code that converts float to Float converts Float to String converts String to float
converts float to String converts String to Float converts Float to float.
EXPERIMENT 10

TITLE: Threads

1) Write a program to implement the concept of threading by extending Thread Class and Runnable
interface.

2) Write a program for generating 2 threads, one for printing even numbers and the other for
printing odd numbers.

3) Write a program to launch 10 threads. Each thread increments a counter variable. Run the
program with synchronization.

4) Write a Java program to create five threads with different priorities. Send two threads of the
highest priority to sleep state. Check the aliveness of the threads and mark which thread is long
lasting

EXPERIMENT 11

TITLE: Files and Stream

1) Write a program in Java, which takes the name of a file from user, read the contents of the file
and display it on the console.

2) Write a Java program to copy a file into another file

3) Write a Program that reads a file and display the information that whether the file exists or not,
to display the information about the file and find the type of file whether readable, writable and
the length of bytes.

4) Write a java program to perform the following operations based upon the choice entered by the
user.
a) Reading input from a file (f1) and displaying it in the console.
b) Read the input from the program itself and write to the file (f2).
c) Concatenation of files (f1 and f2) -> f3
d) Appending information to file f3
e) Perform word count on f3.

5) Write a program that will count number of characters, words and lines in a file. The name should
be passes as command line argument.

EXPERIMENT 12

TITLE: Collections

1) Write a program for the following:


Read all elements from ArrayList by using Iterator.

Create duplicate object of an ArrayList instance.

Reverse ArrayList content.

2) Write a program for the following HashMap


find whether specified key exists or not.

find whether specified value exists or not

get all keys from the given HashMap

get all key-value pair as Entry objects

3) Write a program for the following HashSet


copy another collection object to HashSet object.

delete all entries at one call from HashSet

search user defined objects from HashSet


F. SUGGESTED READINGS:
1. The Java Programming Language 3rd Edition, Ken Arnold, James Gosling, Pearson
2. A premier guide to SCJP 3rd Edition, Khalid Mughal, Pearson
3. Thinking in Java, 3rd Edition, Bruce Ackel, Pearson

F : 3 VIDEO RESOURCES (URL LINK) AND NPTEL LECTURES

http://www.youtube.com

GUIDELINES

Cell Phones and other Electronic Communication Devices: Cell phones and other electronic
communication devices (such as Blackberries/Laptops) are not permitted in classes during
Tests or the Mid/Final Examination. Such devices MUST be turned off in the class room.

E-Mail and LMS: Each student in the class should have an e-mail id and a pass word to
access the LMS system regularly. Regularly, important information Date of conducting
class tests, guest lectures, via LMS. The best way to arrange meetings with us or ask specific
questions is by email and prior appointment. All the assignments preferably should be
uploaded on LMS. Various research papers/reference material will be mailed/uploaded on
LMS time to time.

Attendance: Students are required to have minimum attendance of 75% in each subject.
Students with less than said percentage shall NOT be allowed to appear in the end semester
examination.

Passing criterion: Student has to secure minimum 30%/40% marks of the highest marks in
the class scored by a student in that subject (in that class/group class) individually in both the
End-Semester examination and Total Marks in order to pass in that paper.

Passing Criterion for B. Tech: minimum 30% of the highest marks in the class

Passing Criterion for M. Tech: minimum 40% of the highest marks in the class

You might also like