Core_Adv_Java_Assignmentsuwaechiuiaebc
Core_Adv_Java_Assignmentsuwaechiuiaebc
15. Write a program to Input two 3 X 3 Array and perform below operation:-
1 - Addition
2 – Multiplication
Week – 1
4. Program that accepts number of days as integer value and display total
number of years , months and days in it.
5. Program to convert temparature from farenheit to celsius . Use formula (C= 5
* (f – 32) / 9)
8. Program to print full name entered by user in reverse order. (Only words are to
be reveresed not the characters inside it and Take input via command line
arguments)
9. Program that accepts 2 numbers via command line arguments and prints next
2
adjacent even numbers after them.
10. Program that prints features of java in systematic way as we get to see in
books with proper formatting. Use tab , white spaces , new line characters to
provide definition term and definition data type layout.
Week – 2
1) If basic salary of empoyee is less than Rs. 1500 , then HRA = 10% of basic
2) If basic salary is greater tahn or equal to Rs. 1500 , then HRA = Rs. 500 and
DA = 98% of basic salary
Accept basic salary as input and calculate HRA , DA AND Total Salary
of employee
5. Print Lucas Series starting from any user entered number (up to 10 values) : 1, 2
, 3 , 6 , 11 , 20 , 37 , ......
8. Create a class to calculate Area of circle with one data member to store the
radius and another to store area value. Create following member methods :
1) init() : to input radius from user
9. Create a class Person with properties (name and age) with following features :
Week – 3
1. Create a class Tile to store the edge length of a square tile and create
another class Floor to store length and width of a rectangular floor. Add
method totalTiles(Tile t) in Floor class with Tile as argument to clculate
the whole number of tiles needed to cover the floor completely.
1) two integer
c) Create another class CollegeStudent that inherits Student class. Add a new
member semester to it.Create default and parameterised constructors , also
e) Create a class XYZ with main() that carries out following operations -
ii) Create two CollegeStudent and three SchoolStudent record objects and stire
iv) Search record on the basis of rollno nad check given rollno is of
SchoolStudent or of CollegeStudent
6. Create an abstract class Processor with int member variable – data and method
- showData() to display data value. Create an abstract method process() to
define procesing of member data.
a) Create a class Factorial using abstract class Processor to calculate and print
b) Create a class Circle using abstract class Processor to calculate and print
area of circle by overriding the process() method.
c) Ask user to enter choice (factorial or circle area). Alo ask data to work upon ,
Week – 4
campus.data
Person(name, age ,address)
campus.academics
1)Student(rollno, breanch, semester) inherits Person
campus.accounts
Fees(Student, amount , paymentDate)
Campus
CampusApp – this class contains main()
to accept 4 students info with their fees
for second semester and print total fees
collected fromall 4 students
Create this application as a runnable jar.
2. Input data exactly in the following format and print sum of all integer values.
4. Create a method process() that will accept an integer number as a parameter and
depending on user's choice calculate a) reverse b) square c) half of the number .
(process() should appear only once in the code , overloading is not allowed.)
Week – 5
a) eno and ename should be printed on screen when Employee object is printed
6. Write a p[rogram to read data from above created shopping.dat file and find total
money spent on all shopping items. (use ObjectInputStream to store Item class object)
7. Write a program to count total no. Of bytes in an image file saved on your PC. Also
find find how much time will it take to upload the file on server if internet speed is
256 bps(bits per second)
Week – 6
1 . Print following pattern on screen with delay of 2 second between each print of *.
***
**
b) If a writer is writing to a file no other writer shoudl be allowed to write to the file.
Demonstrate the scenario where Printer can print only one document at a time.
4. Design a Frame based application as shown below figure and on click of button
display
If User type any City in the text Field and click on Add button then it should be added
in
on Add button without enter any text then a message should be displayed “Please
Enter city
name ”.
Week 1
1) Write a java program to create ArrayList of any type and perform following operations :
1) Add elements to arraylist and print them using for-each loop
3) Ask for position and new element from user , check if the position is valid and then
insert the user entered element at that position
4) Ask for position from user and then retrieve the element at that position , proper
error message should be displayed if the position is invalid.
5) Ask for position from user and then delete the element at that position , proper
error message should be displayed if the position is invalid.
6) Ask for position from user and the new element and then replace the element at
that position , proper error message should be displayed if the position is invalid.
7) Ask for element from user and then delete that element from the arraylist , proper
error message should be displayed if the element is not present in the list.
2) Write a java program to create ArrayList of Account type and perform following
operations :
class Account
2) Sort the elements of the arraylist based on ascending order of their acct_number.
3) Sort the elements of the arraylist based on descending order of their balance.
4) Whenever any element of the arraylist is printed the balance and acct_number of
the accounts should be printed.
3) Write a java program to create LinkedList of any type and perform following operations :
4) repeat an element in the linkedlist and then display index of the element's first
occurance and last occurance.
4) Write a java program to create HashSet of Mobile type and perform following operations :
class Mobile
{
2) Ask for mobile price from user and then display the mobile's price and maker if it is
present in the HashSet , if not display proper message on screen.
3) If any Mobile object is repeated , it should not be saved into the HashSet again.
4) Ask for mobile maker from user and then delete that Mobile object from the
HashSet , if not present , display proper message on screen.
5) Write a java program to create TreeSet of Voter type and perform following operations :
class Voter
1) Store objects of Voter class into the TreeSet , sorting should happen on the basis of
Voter's age.
2) Ask for age of Voter from user and then display the Voter's age and name if it is
present in the TreeSet , if not display proper message on screen.
3) Ask for Voter's name from user and then delete that Voter object from the HashSet
, if not present , display proper message on screen. If multiple voter's with same name exist ,
delete all of them.
6) Write a java program to create HashMap where key should be of the type Integer and
value should be of the type String and perform following operations :
4) Ask for key, original value and new value from user , check if the any entry with the
specified key already exists if yes then replace the original value by the new value.
5) Ask for key from user , if the any entry with the specified key exists then delete the
entry else display proper message on screen.
6) Ask for key, value from user , check if the any entry with the specified key and the
value already exists if yes then delete the entry else no changes are to be done.
7) Write a java program to create TreeMap where key should be of the type Student class
and value should be of the type String (Value will represent Student's Name) and perform
following operations :
class Student
2) Display list of all keys from the HashMap (combination of rollno and division should
be displayed).
Week 2 :
1) QuestionCategory table:
Column Column_Type
2) QuestionSubCategory table:
Column Column_Type
3) Question table:
Column Column_Type
desc varchar(200)
postedDate date
status boolean
visibility boolean
Statement.
PreparedStatement.
4) Write a java program to show meta data information about the ResultSet generated by
running "select * from Student" query on the above Student table.
Week 3 :
1) Take date of birth from user on HTML form (form action -> "getdata" , method ->
"get")
1) Take 2 numbers from user on HTML form and choice of action using 3 radiobuttons
with choice as "ADD" , "SUBTRACT" , "MULTIPLY" (form action -> "takeinput")
4) On Decide servlet check which choice has been done by the user and depending on
the choice redirect the user to corresponding servlet and display the result of the operation.
1) Take name from user on HTML form and choice of favorite color using 3
radiobuttons with choice as "RED" , "YELLOW" , "BLUE" (form action -> "takecolors")
3) Store username and selected color inside separate cookies on SetCooky servlet
4) There should another servlet named as GetCooky which will retrieve the cookies
and display data present in them on screen.
5) Write a java servlet program to do following :
1) Take userid and password from user on HTML form (form action -> "checkuser")
3) Run query on database table (User) to check whether the entered userid and
password is correct
5) userid should be saved in the session , the saved userid should be displayed on
ProfileServlet
Week 4 :
1) Take date of birth from user on HTML form (form action -> "getdata" , method ->
"get")
1) Take 2 numbers from user on HTML form and choice of action using 3 radiobuttons
with choice as "ADD" , "SUBTRACT" , "MULTIPLY" (form action -> "takeinput")
4) On Decide.jsp check which choice has been done by the user and depending on the
choice forward the user to corresponding JSP page and display the result of the operation.
(Use jsp:forward)
1) Take userid and password from user on HTML form (form action -> "checkuser")
3) Run query on database table (User) to check whether the entered userid and
password is correct
4) Write a JSP program to do the same thing specified in above question using MVC pattern.
(Bean class, jsp:useBean , session object must be used). After logout when user clicks on
BACK button of the web browser , user should not be shown the Profile page again.
1) Take user's email-id , name , password , profile photo from user in a HTML
registration form.
2) The profile photo should be saved to specific location on the web server (File
Uploading)
4) the path of the location where the profile photo has been saved must also be
saved to the database table along with the file name.
6) In above program , implement a Filter to count how many users did try to register to the
website.
7) Write a JSP Program to connect to following URL and get the json from it :
https://reqres.in/api/users?page=2
Parse the json , find out following and display it in html table :
Week 5 :
1) Take userid and password from user on HTML form (form action -> "checkuser")
2) Run query on database table (User) to check whether the entered userid and
password is correct
4) userid should be saved in the session , the saved userid should be displayed on
Profile.jsp
1) Take user's email-id , name , password , profile photo from user in a HTML
registration form.
2) The profile photo should be saved to specific location on the web server (File
Uploading)
4) the path of the location where the profile photo has been saved must also be
saved to the database table along with the file name.