Java Programms
Java Programms
Java Programms
//Experiment Programs
24.Develop a program to display name of players who played more test
matches.Given: Names and No. of test matches played of three players.
25.Develop a program to do the addition of two numbers if both are greater
than 10.
26.Develop a program to print the multiples of 5 between 20 to 70.
27.Develop a program to print 7 terms of the Fibbonacci series.
28.Develop a program to find names of those companies which have more than
10000 employees. Given:Names and No. of employees of four companies.
6. Write a program to implement a vector class and its method for adding and
removing elements. After remove display remaining list. (4m)
7. Define a class Item having data member code and price. Accept data for one
object and display it.(4M)
8. Write a program to create a vector with seven elements as (10, 30, 50, 20,
40, 10, 20). Remove element at 3rd and 4th position. Insert new element at
3rd position. Display the original and current size of the vector. (8m)
9. Write a program to accept a number as command line argument and print the
number is even or odd. (4m)
10.Write a program to implement following inheritance : (4M)
a.
11.WAP to define class student having data members roll no & name. Derive a
class attendance with data member as present days. Write a method to
calculate & print average attendance assuming total days as 180.
12.Define a class Item having data members code & price. Accept the data for
five objects & display data in tabular form using array of objects. Also
display total price of all item.
13.WAP to check whether given string is palindrome or not.
14.Define a class employee with data members as emp_id and salary. Accept
data for 5 objects and print it.
15.WAP to accept a number from user & convert it into binary, Hexadecimal
and octal format & print it.
16.Write a program which will read string and rewrite it in the alphabetical
order for example the word “Java” should be written as “aaJv”.(Ignore the
case of the letter).
17.Write a program in Java to read 10 strings from console and then print the
stored strings on console. (Use String Class).
18.Write a program to demonstrates the following.
(i) To convert lower case string to upper case
(ii) To calculate the length of given string
(iii) To compare two strings
Mr. Bhandare P.S.
19.Accept an array of 10 floats from user and find the largest number among
them.
20.Input a number from command line and find its binary, octal and
hexadecimal equivalent.
21.Count numbers of vowels in the StringBuffer.
22.Accept first name, middle name and surname from keyboard and display the
while in sequence as a single string.
23.Display the string in reverse order.
24.Accept any string containing all types of characters and symbols from user
and count only number of digits.
25.Sort the characters of the string inputted from user.
26.Accept marks and roll no of 10 students from user and display roll number
of student having highest marks.
27.Input a string from user and invert the case of each character of the string.
E.g. Input: “RaJaN” output: “rAjAn”.
28.Implement a stack using vector. Implement all basic operations on vector.
29.Implement a queue using vector. Simulate insert and delete operations.
30.Perform multiplication on two different 3 X 3 matrices.
31.WAP to sort the array elements.
32.WAP to search element in unsorted array
33.WAP to Insert element into array.
34.WAP to delete element from array.
35.WAP to add two 3x3 matrices.
36.WAP to Subtract two 3x3 matrices.
37.WAP to transpose a matrix.
//Experiment Programs
38.Define a class ‘Mobile’ with data members ‘company_name’ &
‘screen_size’.Initialize and display values of data members for 5 mobiles
using array of objects.
39.Define a class ‘Cube’ with data members length,breadth and height.
Initialize three objects using different constructors and display its volume.
40.WAP to find all substrings of a string and print them. For example
substrings of ‘fun’ are:- ’f’, ‘fu’,’fun’, ‘u’, ‘un’ and ‘n’. Use substring
method of String class to find substring.
41.Implement a program to accomplish the following task using String and
StringBuffer class:
Mr. Bhandare P.S.
a.
Mr. Bhandare P.S.
a.
5. Design a package containing a class which defines a method for arithmetic
operations. Import it in Java application and perform the operations.
6. Define a package named ‘useFul’ with a calss names ‘UseMe’ having
following methods:
1)area()- To calculate the area of given shape.
2)salary()- To calculate the salary given basic Salary,da,hRA.
3)percentage()-To calculate the percentage given total marks and marks
obtained.
4)Develop a program named ‘Package Use’ to import the above package
‘useFul’ and use the method area().
5) Develop a program named ‘manager’
Chapter 4: Exception Handling & Multithreaded Programming
1. Write a program to define, instantiate and start new thread using
java.lang.Runnable.
2. Write a program to create two threads so one thread will print ascending
numbers whereas second thread will print descending numbers between
sequence 1 to 15 numbers.
3. What is exception? WAP to accept a password from the user and throw
“Authentication Failure” exception if the password is incorrect. (8M)(S-17)
4. Write a program to create two threads, one to print numbers in original order
and other in reverse order from 1 to 10. (8M) (S-17)
Mr. Bhandare P.S.