Skip to content

One stop destination for the entire Java Lab Manual! You'll probably not need any other study material for it!

License

Notifications You must be signed in to change notification settings

Rohan-San/Java-Lab

Repository files navigation

Java Lab Sem 5

Repository to understand the Application Development using Java Laboratory.
Program files contain the code as well as the tested outputs.
Refer viva.md for possible viva questions!
Refer servlet-jsp.md for basic instructions for the servlet and jsp programs
Code Reference: Davin's repository

Questions

  1. Write a java program:
  • To calculate and display the roots of Quadratic Equation.
  • To multiply two arrays and display the result
  • To sort the elements in ascending and descending order using bubble sort algorithm.
  1. Write a java program to create an Employee database which stores following information about the Employee: Name, Emp_id, department, age, and designation. Perform the following operations:
  • Read and display the details of at least five Employees.
  • Calculate and display the sum of salary of all the employees of “sales” department.
  • Retrieve the details of “highest paid manager” in the purchase department.
  1. Write a Java program using encapsulation and constructors to create a class to represent a complex number and perform the following operations:
  • Addition of two complex numbers
  • Subtraction of two complex numbers
  • Compare two complex numbers.
  1. Write a java program to define a base class called person which stores information about a person such as name, age, gender. Derive two new classes employee and student and extend the base class methods in derived class to read and display the details that are specific to student and employee. Display the details of at least five students and five employees.

  2. Write a java program using compile time polymorphism (method overloading) to compare two strings. The program should implement two different versions of strcmp the first version of usrstrcmp () that compares two string the second version should compare only specified number of characters from first string with second string and display the results.

  3. Write a java program to define a base class bank, which holds various details of customers such as name, account number, balance and member functions to read, display and an abstract method to calculate rate of interest earned by all the account holders. Derive three classes namely City-Bank, SBI-bank, Canara-bank from this base class, which are offering different rate of interests. Extend the calculate method of base class with in these derived classes to calculate and display the interest earned by all the account holders of these banks.

  4. Write a multi-threaded java program to illustrate producer consumer problem.

  5. Write a java program to read two positive integers and perform the division operation on them and display the result if a user enters a positive integer and non-zero denominator. Else, If the input is negative or the denominator is zero, generate negative number input and divide by zero exception to handle the scenario.

  6. Write a java program to define an interface 'compute' with an abstract method convert, define two classes which implements the compute interface and extend the convert method to convert giga bytes to bytes and Euro to rupees. Declare objects for both the classes and demonstrate the conversion from giga bytes to bytes and euro to rupees.

  7. Write a java program that connects to a database using JDBC and does add deletes, modify and retrieve operations.

  8. A web application that takes name and age from an HTML page. If the age is less than 18, it should send a page with “Hello [name], you are not authorized to visit the site” message, where [name] should be replaced with the entered name. Otherwise it should send “Welcome to this site” message.

  9. A web application that takes a name as input and on submitting, it shows a hello page where name is taken from the request. It shows the start time at the right top corner of the page and provides a logout button. On clicking this button, it should show a logout page with Thank You [name] message with the duration of usage (hint: Use session to store name and time) USING JSP.

Dependency Management

The JAVA PROJECTS view allows you to manage your dependencies. More details can be found here.

About

One stop destination for the entire Java Lab Manual! You'll probably not need any other study material for it!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages