You are on page 1of 4

SARDAR PATEL UNIVERSITY

Vallabh Vidyanagar
B.C.A. Semester – V
Object Oriented Programming - III Lab (US05CBCA26)
SIMPLE PROGRAM IN NETBEANS

1. Write a java program to enter your Name, Gender, Roll No, Mobile No and City and
display.
2. Calculate net salary of employee with following constraints by overloading salary ().
 If employee is manager, pass basic, da, hra, ma, pf, it, pt
 If employee is executive, pass basic, da, hra, pf, it
 If employee is jn_executive, pass basic, da, hra, it
 If employee is peon, pass basic, da.
3. Create arrays of N items. Enter item name, qty and rate. Calculate and display net
amount for each item. Also display item having highest net amount.

JDBC PROGRAM

4. Develop a program to perform the database driven operation like insert, Delete, Update
and select. To perform the above operations
Create table named Employee in MYSQL.
Field Name: EmpId , Empname, Emp_desig , Emp_J_Date, Emp_Salary

5. Write a menu driven an Application program to do following:


Create table Student: std_no, std_name, std_sub1, std_sub2, std_sub3, total, percentage
in MYSQL
 New Student Entry
 Calculate student result
 Display specified student’s formatted Mark sheet
 Delete Student Entry
 Modify the Student info
 Exit

1
6. Create a table named USER in MYSQL database. Add two records into this table as
shown below:
USERNAME PASSWORD
admin Admin
user1 user1

Write a program to connect take username and password as input through keyboard from
the user. Use JDBC code to validate if given username and passwords are correct as per the
table given above. Display appropriate message depending on the outcome of the
validation.

7. Create a table in MYSQL as shown below:


BOOK_ID TITLE AUTHOR_NAME PRICE
1001 LET US C YASHWANT KANITKAR 250.00
1002 CLEAN CODE ROBERT MARTIN 450.00
1003 REFACTORING MARTIN FOWLER 550.00

Write a menu-driven JDBC program to:


1) Insert a new record
2) Update existing record for given BOOK_ID
3) Delete existing record for given BOOK_ID
4) Search for the record for given TITLE

SERVLET PROGRAM

8. Create servlet to display “Hello World”.

2
9. Create servlet to display “SARDAR PATEL UNIVERSITY” when user click on submit
button.
10. Create servlet to display “SARDAR PATEL UNIVERSITY” when user click hyper
link.
11. Create three radio button which indicate color name like RED, GREEN and BLUE. If
user selects red, then display background color as red for response page.
12. Create login page, it takes user name and password. Create servlets which check user
name and password if both are admin then display welcome user else display wrong
user name or password.
13. Create html file in which user can take two numbers in two text boxes, one drop-down
list with different arithmetic operator and one submit button. Create servlet to perform
arithmetic operation based on user selected operator from drop-down list.
14. Create servlet to Check given number is
 Check for positive or negative number
 Check for odd or even number
 Check for primary number
 Check for Palindrome number
 Check for Armstrong number
 Check for number whether a member of Fibonacci series
 Exit
Note: Use Button or Radio Button

JSP PROGRAM

15. JSP program display welcome to JSP.


16. JSP program Print current date & time.
17. JSP Program to display given number in words.
18. JSP Program to given a sting str =”sardar patel university”. Perform the following
operation on it.
 Find the length of string
 Replace the character p’ by ‘r’
 Convert all character in uppercase
 Extract and print “sardar” from given string.

3
19. JSP Program to upload file into server.
20. JSP Program to auto refresh a page.
21. JSP Program to count no. of visitors on website.
22. JSP Program to validate username and password using database connection.
MULTITHREADED PROGRAMMING
23. Write a java program creating and invoking a thread object by extending the standard
Thread class.
24. Write a java program Implement a class that checks whether a given number is a prime
using both the Thread class and Runnable interface.
25. Write a java program which shows altering order of threads by changing priority.
Creates 3 threads, and adjusts the priority of each thread. The possible output of the
example is shown as follows:

26. Write a java program simple Timer that can periodically print a timeout message.
27. Write a java program for the fruit market. The farmer will be able to produce different
types of fruits (apple, orange, grape, and watermelon), and put them in the market to
sell. The market has limited capacity and farmers have to stand in a queue if the capacity
is exceeded to sell their fruits. Consumers can come to the market any time and
purchase their desired fruits; and if the fruits they want to buy runs out, they are willing
to wait until the supply of that kind is ready. (Hint: implementing this market will
encounter the producer and consumer problem, and it probably needs multiple buffers
for different kinds of fruits).

You might also like