KEMBAR78
Assignment I Github Repository | PDF | String (Computer Science) | Http Cookie
0% found this document useful (0 votes)
32 views7 pages

Assignment I Github Repository

This document outlines an assignment for an Advanced Java course, detailing the execution and submission of 28 Java programs with specific requirements for code and output documentation. Students must upload their code to a GitHub repository, include comments, and provide links to program outputs in a README file. The assignment covers various topics including ArrayLists, LinkedLists, string operations, Swing applications, servlets, JSP, and JDBC programming.

Uploaded by

4al22cs128
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views7 pages

Assignment I Github Repository

This document outlines an assignment for an Advanced Java course, detailing the execution and submission of 28 Java programs with specific requirements for code and output documentation. Students must upload their code to a GitHub repository, include comments, and provide links to program outputs in a README file. The assignment covers various topics including ArrayLists, LinkedLists, string operations, Swing applications, servlets, JSP, and JDBC programming.

Uploaded by

4al22cs128
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Assignment I

Subject Name : Advanced Java Subject Code : BCS613D


Issue Date : 12.05.2025 Submission Dead Line : 21,22,23.05.2024 ( A,B,C respectively)
Submission Mode : Online through Github repository.
Mark weightage : 10 Marks

Execute the following programs and upload the code ( .java file) in your Github repository with
README file showing the link for the output of the program

Sample of upload onto the Github repository ( for example here AbstractClass.Java code has
been uploaded onto the repository as follows along with output file

If you click on AbstractClass.Java file , it should show the code like this
You should create a link the README file to show the output of the program as follows

If you press AbstractClass o/p link , it should display the output as follows

Similarly you have to upload the following 28 programs with respective outputs in README in
the form of links .

Important Notes :

• The questions has to be given as first comment line of the code .


• The comment lines should be specified where ever necessary in the code
• Every program should have output link the README file
• Dynamic project files should be copied with all necessary coding files ( .java, .html, .jsp )
• JDBC programming files should contain the details of all Database, tables with its
structures and format.
Caution :

Don’t try to clone the entire repository / individual file from others repository. It will be easily
detected and the assignment marks will be awarded ZERO
1.a Develop a Java program for adding elements [Apple, Banana, Orange] into an ArrayList
and a LinkedList to perform the following operations with different functions directed as
follows
1. Adding elements, 2. Adding element at specific index, 3. Adding multiple elements, 4.
Accessing elements,5. Updating elements, 6. Removing elements, 7. Searching elements, 8. List
size, 9. Iterating over list, 10. Using Iterator, 11. Sorting, 12. Sublist, 13. Clearing the list

1b. Array List programs

1. Write a java program for getting different colors through ArrayList interface and search whether
the color "Red" is available or not

2. Write a java program for getting different colors through ArrayList interface and remove the
2nd element and color "Blue" from the ArrayList
3.
4. Write a java program for getting different colors through ArrayList interface and sort them
using Collections.sort( ArrayListObj)

5. Write a java program for getting different colors through ArrayList interface and extract the
elements 1st and 2nd from the ArrayList object by using SubList()

6. Write a java program for getting different colors through ArrayList interface and delete nth
element from the ArrayList object by using remove by index

1c. Linked List Programs

1. Write a Java program to iterate through all elements in a linked list starting at the
specified position ( 2nd) using iterator ( hint : Iterator iteratorobj = listobj.listIterator(1))

2. Write a Java program to iterate a linked list in reverse order (using


objlist.descendingIterator())

3. Write a Java program to insert the specified element at the end of a linked list.( using
l_listobj.offerLast("Pink"))

4. Write a Java program to display elements and their positions in a linked list ( using
l_listobj.get(p) )
5. Write a Java program that swaps two elements ( first and third elements ) in a linked list ( using
Collections.swap(l_list, 0, 2))
2 a. Develop a java program for performing various string operations with different string
handling functions directed as follows
String Creation and Basic Operations, Length and Character Access, String Comparison, String
Searching, Substring Operations , String Modification, Whitespace Handling, String
Concatenation, String Splitting, StringBuilder Demo, String Formatting , Validate Email with
contains( ) and startsWith() and endsWith()

2.b. Develop a Java program to make a Performance Test on StringBuffer and StringBuilder for
appending the string ‘AIET’ for 10000 times both in the StringBuffer and StringBuilder. Justify
your answer which one is better.

3a. Develop a java program for performing various string operations with different string
handling functions directed as follows:
String Creation and Basic Operations, Length and Character Access, String Comparison, String
Searching, Substring Operations , String Modification, Whitespace Handling, String Concatenation,
String Splitting, StringBuilder Demo, String Formatting , Validate Email with contains( ) and
startsWith() and endsWith()

3b. String Exercise progams

Q1. Write a Java Program for Checking if a given string is null or contains only whitespace using user
defined function isNullOrEmpty().

Q2. Write a Java Program for Counting how many times a substring appears in a main string
using user defined function countOccurrences()

Q3. Write a Java Program for Reversing the characters in a string using user defined function
reverseString().

Q4. Write a Java Program for Checking if a string reads the same backward as forward (ignoring case
and punctuation) using user defined function isPalindrome():

Q5. Write a Java Program for Eliminating all whitespace characters from a string using user defined
function removeWhitespace()

3c. String Exercise progams

Q6. Write a Java Program for Capitalizing the first letter of each word. using user defined function
capitalizeWords()

Q7. Write a Java Program for Shortening a string to a specified length and adds an ellipsis using user
defined function truncate()

Q8. Write a Java Program for Verifying if a string contains only numeric characters using user defined
function isNumeric()
Q9. Write a Java Program for Creating a random string of a specified length using user defined
function generateRandomString()

Q10. Write a Java Program for Counting the number of words in a string using user defined function
countWords()

4a. Basic hello program of Swing displaying the message Hello! VI C , Welcome to Swing
Programming in Blue color plain font with font size of 32 using Jframe and Jlabel

4b. Develop a Swing program in Java to display a message “Srilanka is pressed” or “India is
pressed” depending upon the Jbutton either Srilanka or India is pressed by implementing the
event handling mechanism with addActionListener( ).

4c. Develop a Swing program in Java to display a message “Digital Clock is pressed” or “Hour
Glass is pressed” depending upon the Jbutton with image either Digital Clock or Hour Glass is
pressed by implementing the event handling mechanism with addActionListener( ).

5a. Develop a Swing program in Java to add the countries USA, India, Vietnam, Canada,
Denmark, France, Great Britain, Japan, Africa, Greenland, Singapore into a JList and
display them on console whenever the countries are selected on the list.

5b. Develop a Swing program in Java to create a Tabbed Pan of RED, BLUE and GREEN and
display the concerned color whenever the specific tab is selected in the Pan.

5c. Develop a Swing program in Java to add the countries USA, India, Vietnam, Canada,
Denmark, France, Great Britain, Japan, Africa, Greenland, Singapore into a JList and
display the capital of the countries on console whenever the countries are selected on the list.

5d. Develop a Swing program in Java to create a Tabbed Pan of Cyan, Magenta and Yellow and
display the concerned color whenever the specific tab is selected in the Pan

6a. Build a servlet program to find the factorial of a number using HTML with step by step
procedure.

6b. Build a servlet program to create a cookie to get your name through text box and press submit
button( through HTML) to display the message by greeting Welcome back your name ! , you have
visited this page n times ( n = number of your visit ) and demonstrate the expiry of cookie also.

6c. Build a servlet program to check the given number is prime number or not using HTML with step
by step procedure.

7a. Build a Session Management using JSP program set with one minute session expiry time to get
your name through text box and press submit to display the message by greeting Hello your name!.
Check the expiry of the session after one minute.

7b. Construct a Cookie Management program using JSP to get the fields Name, Domain and Max
Expiry Age ( in sec) and press the button Add Cookie for displaying the set cookie information. Then
it has to go to show the active cookie list when you press the link go to the active cookie list
8a. Q1. Read all the existing records from the table coffee which is from the database test and insert a
new coffee product into it [Create a table coffee with fields ( id,coffee_name,price)] using HTML and
JSP to get the fields and display the results respectively

8b. Read all the existing records from the table coffee which is from the database test and update an
existing coffee product in the table with its id. [Create a table coffee with fields
( id,coffee_name,price)] using HTML and JSP to get the fields and display the results respectively

8c. Develop a JDBC project using JSP to append the fields empno, empname and basicsalary
into the table Emp of the database Employee by getting the fields through keyboard and
Generate the report as follows for the TABLE Emp (Emp_NO , Emp_Name, Basicsalary ) using
HTML and JSP to get the fields and display the results respectively

Salary Report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emp_No : 101
Emp_Name: Ramesh'
Basic : 25000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emp_No : 102
Emp_Name: Ravi
Basic : 20000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
….

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~````
Grand Salary : 45000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

8d. Develop a JDBC project using JDBC to update the fields empno, empname and basicsalary into
the table Emp of the database Employee using HTML and JSP to get the fields and display the
results respectively

9a. Read all the existing records from the table coffee which is from the database test and delete
an existing coffee product from the table with its id and display the rest of the records using
HTML and JSP to get the field and display the results respectively

9b. Read all the existing records from the table coffee which is from the database test and query
coffee name starting with ‘D’ in the table using HTML and JSP to get the field and display the
results respectively
9c. Develop a JDBC project using MySQL to append the fields empno, empname and basicsalary
into the table Emp of the database Employee by getting the fields through keyboard and Generate
the report as follows for the table Emp (Emp_NO , Emp_Name, Basicsalary ) using HTML and JSP
to get the field and display the results respectively

9d. Develop a JDBC project using MySQL to delete the records in the table Emp of the database
Employee by getting the name starting with ‘S’ through keyboard and Generate the report as
follows using HTML and JSP to get the field and display the results respectively

Salary Report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emp_No : 101
Emp_Name: Ramesh'
Basic : 25000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emp_No : 102
Emp_Name: Ravi
Basic : 20000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You might also like