SampleOOP_QuestionBank
SampleOOP_QuestionBank
Write a class called “result” which implements both interfaces .The pass method
should return true if marks is greater than 40 else false. The division method must
return divisions i.e. first, second; third, pass depending upon the average
marks(average marks calculated from 3 subjects accepted from the user).
2. WAP to create a basic registration form for a library website with all the possible
components , include minimum two buttons within the form also add action
listeners on click of the buttons.
4. Write a JAVA program to remove extra spaces between words in the string
E.g.:
I/p—Hello world welcome all
O/p—Hello world welcome all
1. Crocin 15 10 150.00
2. Diclogem 10 5 50.00
Total : 200.00
6. Write a program to multiply the two matrices.
Check for the condition of multiplication. If the condition fails, a program should
throw an exception” Matrices cannot be multiplied” otherwise the program should
display the multiplication result.
7. WAP to accept numbers from user using command-line arguments and throw an
exception “Odd Number”,if the number entered is odd.
Also find sum of all the numbers except the odd ones.
8. Write a Java program that accepts two integers via BufferedReader class
from the user and then prints the sum, the difference, the product, the
average,the maximum (the larger of the two integers), the minimum
(smaller of the two integers).
10. WAP to create a basic registration form for a college website with all the possible
components.
11. WAP to accept a sentence from the user. Display the accepted sentence in a camel
case form.
14. WAP to create a basic registration form for a bank website with all the possible
components.
Ex:
Enter a string : welcome to java
Sorted version of string: ceelmow ot aajv (without using inbuilt method)
21. WAJP using multiple classes that checks whether two arrays have the same
elements, ignoring multiplicities.
22. A bookshop maintains the inventory of books that are being sold at the shop. The
list includes details such as author, title, price publisher and stock position.
Whenever customer wants a book he inputs the title and author program searches
the list and displays whether it if available or not.
If the requested copies are available, the total cost of requested copies is displayed
otherwise the message “Required copies not in stock” is displayed.
If the string is not a Palindrome, then a user defined exception should be thrown
“String is not a Palindrome”
24. Write a program to create a class student with Name, Id, Branch, College-Name
as data members where College-Name is a static data member.
Now count the number of students belonging to IT and Computers branch using
static members and functions.
A program should throw an exception for branches other than Computers and IT.
25. Write a program that accepts a list of five integers from the command line and
stores them in a vector. Modify the program to accomplish the following.
(Hint : A matrix is symmetric if (a[i][j] = a[j][i] ) for all values of i and j.)
Also, find the sum of all the non diagonal elements if it is Symmetric.