Sie sind auf Seite 1von 6

K. J.

SOMAIYA COLLEGE OF ENGINEERING, VIDYAVIHAR


FE SEM II (ALL DIVISIONS) 2008 2009
Final Experiment List for CP II
Unit 1 : Fundamentals of Java
1. Simple and Compound Interest
Write a function simple to compute and return simple interest. Also
write function compound to compute and return the compound interest.
Use these function in main and display the result as per the users
choice.

2. Palindrome Numbers
Write a function rev which returns the reverse of the given integer.
Function isPalin takes an integer as argument and checks whether it is
palindrome or not using rev function. Using isPalin write a main function
to accept n integers and display number of palindrome numbers found.

3. GCD and LCM
Write a recursive function gcd to find the gcd of the given two numbers.
Use this in main to find the gcd and lcm two given numbers.

Unit 2 : Arrays

4. Smallest Distance
Write a program which stores n integers in an array. The program finds
distances between two successive integers. Display the smallest
distance found.
E.g. [ 2 4 7 12 5 8 6]
Smallest Distance =2.

5 Multi-dimensional Arrays
Write a program which stores information about n players in a two
dimensional array. The array should contain number of rows equal to
number of players. Each row will have number of columns equal to
number of matches played by that player which may vary from player to
player. The program should display player number (index +1), runs
scored in all matches and its batting average as output. (It is expected to
assign columns to each row dynamically after getting value from user)

6. Searching
Write a program that accepts a matrix of mxn order from the user and a
search element ele. The program should check whether ele is present
in the array or not and display the appropriate message. (Program
should stop searching immediately when the element is found. Make
use of labeled break)



Unit 3 : Object Oriented Programming
7. Distance
Create an appropriate class Distance which stores a distance value in
feet and inches to suit the following main function.
class DistanceExp
{
public static void main(String args[ ])
{
Distance d1=new Distance (4, 5);
Distance d2=new Distance (6, 7);
Distance d3=new Distance( );
d3.add(d1, d2);
d3.display( );
if (d1.compare(d2))
System.out.println(Two distances are equal);
else System.out.pritnln(Two distances are not equal);
}
}
8. Array of Objects
Create a class Product with the following information
Pid
Pcost
Get the information of n products from the user and sort the products in
an increasing order of the product cost. The function sort must be
statically defined to invoke it without referring any object.
Unit 4 : Wrapper classes
9. String and StringBuffer
Write a Program to accept the given n Names of the Colleges and sort
them in an alphabetical order.
10. Command Line Argument
Write a Program to accept any String from command line and display all
the numeric and non numeric characters in it. Use the built- in functions
available with Character Wrapper class.
11. Vector
Create a class Student which stores Name ,Roll_no and Grand_total of
a student. Use class Vector to maintain an array of students in the
descending order of the Grand_total. Provide the following functions
1) create() : this function will accept the n student records in any order
and will arrange them in the sorted order.
2) insert : to insert the given student record at appropriate index in the
vector depending upon the grand total.
3) deleteByName( ) : to accept the name of the student and delete the
record having given name
4) deleteByRollNo( ): to accept the roll no of the student and delete the
record having given roll no.

Unit 5 : Inheritance and Interface
12. Multilevel Inheritance
A class Array stores an array reference, capacity of array and number
of elements currently stored. It also contains a parameterized
constructor and display function. Derive class Array1 which adds a
function insert to insert a new value at the end of the last element
(without checking for overflow). A class Array2 is derived from Array1
which overrides the insert function. The new insert function first checks
for the overflow and inserts the element only if the array is not full. Write
a program using above class hierarchy which also provides the following
programming element.
a) use dynamic dispatch
b) the program should not allow creation of objects of class Array and
Array1

13. Interface
interface Mat
{
void read( );
void display( );
}
Create a class Matrix by implementing interface Mat. Derive class
MatrixOp from Matrix and provide functions to add and multiply two
matrices. Also derive class MatrixSearch from Matrix and add a function
search ( ) which searches given value in the matrix.

Unit 6 : Exception Handling
14. Sum of Arguments
Accept command line arguments from the user. Write a program to add
all the integer arguments found in the command line arguments. Any
non integer argument should be skipped and handled using the
exception handling concept.
E.g. 2 abc 5 1.4 8 d
Sum =15 ( 2 +5 +8 )

15. User Defined Exception
Write a program which accepts marks of a student (between 0 to 100)
and checks whether it is within the range or not. If it is within the range
then it displays marks entered successfully, if not then it throws the
exception of user defined class MarksOutOfRangeException. The
class should contain appropriate toString method to describe object the
class with the out of range marks entered by the user.
Unit 7 : Multi-threading, Packages and Applets
16. Multi-threaded Programming
A class ThreadDemo stores a thread name and an array of Strings.
Constructor accepts the name of the thread and size of the array. It then
creates the array with the given size and reads the elements of the array. The
thread displays thread-name starts and then it displays all the strings one
by one. Write a program to create two threads of the class, one of them
displays the days of week and the other displays the months of the year. The
main thread should also display main thread active when it gets the
timeslice.


17. Packages
Create a package mypackage which contains a class MyMath. The class
contains following static methods.
i) power (x, y) to compute x
y

ii) fact (x) to compute x!
Write a program to find the following series.
cos (x) =1 (x2/2!) +(x4/4!) (x6/6!) + upto n terms (n given by user).
(Do not make use of inbuilt functions. Use the functions of user defined class
MyMath by importing mypackage.)


18. Applets
Create an applet, on running which shows the following output.





.java javac .class J VM

All the text within the circle and rectangles should be taken as parameters
with names heading1, heading 2, heading 5. All the text below the shape
should be taken as parameters with the name title1, title4.






Source
file
Output
J ava
Compiler
Byte
Code
Version
J ava
Interpreter
Mechanical Engineering
LIST OF JOBS TO BE DONE IN BASIC WORK SHOP PRACTICES I AND II

F.E. All Branches Duration of each class 4 hrs.

Compulsory trades: 1. Carpentry Lap Joint
2. Fitting - Male and Female Fitting
Optional Trades: Demonstration Jobs
1. Welding
2. Smithy
3. Electrical Wiring
4. M/C Shop


Semester 1

Semester II


Division Compulsory
Trade
Optional
Trades
Compulsory
Trade
Optional
Trades

Carpentry


Welding

Fitting

Smithy


A, C, E, G,
I
Electrical
Wiring

M/C Shop

Fitting

Smithy

Carpentry

Welding


B, D, F, H,
J

M/C Shop

Electrical
Wiring

LIST OF JOBS TO BE DONE IN M/C SHOP PRACTICES I AND II


S.E.(Mechanical)

Semester III Duration of each class 3 hrs.


1. Welding Lap Joint
2. Smithy Fabrication of cutting Tool by Forging and Grinding
3. Shaping Horizontal and Angular Shaping
4. Turning- Job1: Turning and taper turning
Job 2: Turning, Taper Turning , Grooving and External
Threading
--------------------------------------------------------------------------------------
Semester IV Duration of each class 2 hrs.


Turning
Composite Job.
1. Main Job involving Plain Turning, Taper Turning, Precision turning,
external threading and Knurling

2. Jobs involving Boring, Internal Threading and Internal Taper turning so as to
fit in the corresponding portions on the main job and Straddle Milling

Das könnte Ihnen auch gefallen