Practical List CJP - 24
Practical List CJP - 24
Practical List CJP - 24
3. Write a program to find a greater number among given three numbers using
a) ternary operator
b) nested if.
03 Lab 3 1. WAP to replace substring with other substring in the given string.
3. Create a String Buffer with some default string. Append any string to i th
position of original string and display the modified string. Also display the
reverse of modified string.
04 Lab 4 1.a) WAP that declares a class named Person. It should have instance variables
to record name, age and salary. Use new operator to create a Person object. Set
and display its instance variables.
b) Add a constructor to the Person class developed above.
2. The employee list for a company contains employee code, name, designation
and basic pay. The employee is given HRA of 10% of the basic and DA of 45%
of the basic pay. The total pay of the employee is calculated as Basic
pay+HRA+ DA. Write a class to define the details of the employee. Write a
constructor to assign the required initial values. Add a method to calculate HRA,
DA and Total pay and print them out. Write another class with a main method.
Create objects for three different employees and calculate the HRA, DA and
total pay.
05 Lab 5 1. Write a program which defines base class Employee having three data
members, namely name[30], emp_numb and gender and two methods namely
input_data() and show_data(). Derive a class SalariedEmployee from Employee
and adds a new data member, namely salary. It also adds two member methods,
namely allowance (if gender is female HRA=0.1 *salary else 0.09* salary. DA=
0.05*salary) and increment (salary= salary+0.1*salary). Display the gross salary
in main class. (Tip: Use super to call base class’s constructor0).
Write a program which generates random integers and stores them in a file
named “rand.dat”. The program then reads the integers from the file and displays
on the screen.
11 Lab 11 Write the program that demonstrate the use of Stack, Vector and ArrayList
classes
12 Lab 12 Write a Network program that client sends the data as redius of circle to server
and server received that data and send the resultant area of circle to requested
client.
13 Lab 13 Write a program to count occurrence of character in a string
15 Lab 15 Write programms to create student registration form in applet and store data in
database.