0% found this document useful (0 votes)
5 views

Assignment - 2(Final)

This document outlines the assignment details for the Java Programming course at Kongunadu College of Engineering and Technology for the academic year 2022-2023. It includes various programming tasks for students, such as handling exceptions, creating threads, and implementing user-defined exceptions. The document specifies submission dates and provides sample inputs and outputs for each assignment topic.

Uploaded by

shanthiraaja143
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)
5 views

Assignment - 2(Final)

This document outlines the assignment details for the Java Programming course at Kongunadu College of Engineering and Technology for the academic year 2022-2023. It includes various programming tasks for students, such as handling exceptions, creating threads, and implementing user-defined exceptions. The document specifies submission dates and provides sample inputs and outputs for each assignment topic.

Uploaded by

shanthiraaja143
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/ 14

KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY

(AUTONOMOUS)
NAMAKKAL - TRICHY MAIN ROAD, THOTTIAM, TRICHY
DEPARTMENT OF INFORMATION TECHNOLOGY
YEAR / SEM : II/III ACADEMIC YEAR : 2022 - 2023(ODD)
20IT301 - JAVA PROGRAMMING
ASSIGNMENT - II
PROPOSED DATE : 07.11.2022 SUBMISSION DATE : 14.11.2022
Register Blooms
S.No Name of the Student Assignment Topics CO Mapping
Number Level
Problem Statement:
Get the Input string from user and parse it to integer,if it is not a number it will
throw number format exception catch it and print "Entered input is not a valid for
an integer" Or else print the square of that number.
Sample Input and Output 1:
Enter an Integer : 12 CO3 C
1 621321205001 ABINESH A The square value is 144
The work has been done successfully
Sample Input and Output 2:
Enter an Integer: Java
Entered Input is not a valid format for an Integer
Wite a Java Program to demonstrate the different ways of creating thread. CO4 C
Create a simple menu application using Menu class with help of java program. CO5 C
Write a Java Program to demonstrate the Muliple try and multiple catch
CO3 C
statements.
2 621321205002 ANUSHAA T V
CO4 C
Write a Java Program to demonstrate the creation of thread using extends Applet
Write an applet program to handle all mouse events. CO5 Ap
Write a Program that takes an Input the size of the array and the elements in the
array. The Program then asks the user to enter a particular index and prints the
element at that index.
This program may generates Array Index Out of Bounds Exception.
Use Exception handling mechanism to handle this exception. In the catch block,
print the class name of the exception thrown.
Sample Input and Output 1:
Enter the number of elements in the array:
3
Enter the elements in the array:
20
90
4
Enter the index of the array element you want to to access CO3 C
2
3 621321205003 ARUNKUMAR P
The array element at index 2 = 4
The array element successfully accessed

Sample Input and Output 2:


Enter the number of elements in the array:
3
Enter the elements in the array:
20
90
4
Enter the index of the array element you want to to access
6
Create a Java Program demonstrate the creation of thread using implementing
CO4 C
interface
Create a java frame by extending the Frame class. CO5 Ap
Write a program that takes an Input the size of the array and the elements in the
array. The Program then asks the user to enter a particular index and prints the
element at that index.
Index starts from 0.
This program may generate Array Index Out of Bounds Exception or Number
Format Exception. Use Exception handling mechanisms to handle the exception.
Sample Input and Output 1:
Enter the number of elements in the array:
2
Enter the elements in the array:
50
80
Enter the index of the array element you want to access:
1 CO3 C
The array element at index 1: 80
4 621321205004 ASITHA R
The array element successfully accessed
Sample Input and Output 2:
Enter the number of elements in the array
2
Enter the elements in the array:
50
80
Enter the index of the array element you want to access:
9
java.lang.ArrayIndexOutOfBoundsException

Sample Input and Output 3:


Write a Java Program to creating multiple threads and implementing the life cycle
CO4
of thread.
Write a Java program for Border, Grid and Flow layout management. CO5 Ap
Write a class MathOperation which accepts integers from command line. Create
an array using these paramaters. Loop through the array and obtain the sum and
average of all the elements. Display the result.
Check the various exceptions that may arise like ArithmeticException, CO3 C
NumberFormatException and so on.
5 621321205005 ASRITHA S For example: The class would be invoked as follows:
java MathOperation 1900, 4560, 0, 32500
Write a Java Program to create five different threads and implementing the
CO4 C
threads.
Design a Decimal Manipulation calculator using event–driven programming
CO5 C
paradigm of Java
Write a program with a division method who receives two integer numbers and
performs the division operation. The method should declare that it throws CO3 C
ArithmeticException. This exception should be handled in the main method.
6 621321205006 BALASUBRAMANIYAN M Write a Java Program to creating a thread and implementinh the following
CO4 C
methods : isAlive() and join()
CO5 Ap
Design a Scientific calculator using event–driven programming paradigm of Java
Write a program to take care of Number Format Exception if user enters values
other than integer for calculating average marks of 2 students. The name of the
students and marks in 3 subjects are taken from the user while executing the
CO3 C
program.
7 621321205007 BHUVANESHWARI V In the same program write your own Exception classes to take care of negative
values and values out of range.
Write a Java Program for accessing a thread concepts with different thread
CO4 C
methods.
Write a Java program to implement working with colors, font and Images CO5 C
In order to experiment with exceptions, we will write a programme that divides
CO3 C
two integers. Create a Java application with the name ExceptionDemo.
Write a Java Program to implement the concepts of Thread Priorities CO4 C
8 621321205008 DEEPAKKUMAR P Wite a Applet program to implement the following: Create four check boxes. The
initial state of the first box should be in checked state. The status of each check
CO5 C
box should be displayed. When we change the state of a check box, the status
should be displayed is updated.
The student portal provides user to register their profile. During registration the
system needs to validate the user should be located in India. If not the system
should throw the exception.
Step 1: Create a user defined exception class named “InvalidCountryException”.
Step 2: Overload the respective constructors.
Step 3: Create a main class “UserRegistration” add the following methods.
registerUser - The parameter are string Username, String Usercountry and add the
following logic, CO3 C

the message “User outside India cannot be registered”.


9 621321205009 DHANUSH R J
successfully”.
Invoke the method registerUser from the main method with the data specified and
see how the program behaves,
Name Country Expected Output
Mickey US InvalidCountryException should be thrown.
The message should be “User Outside India cannot be registered”.
Mini India The message should be “User Registration done successfully”
Write a Java Program to implement the concepts of following methods
i) NORMAL_PRIORITY
CO4 C
ii) MAX_PRIORITY
iii) MIN_PRIORITY
Write a Applet Program to implement various Event handling methods CO5 C
Java program demonstrates the IllegalArgumentException. CO3 C
10 621321205010 DHIVYA S Write a Java Program to implement the concepts of Thread Synchronization CO4 C
Program to create a swing Applet and its components CO5 C
Write a Java Program to demonstrates the ConcurrentModificationException. CO3 C
Write a Java Program for Interthread Communication CO4 C
Write an Applet program to implement the following concepts
11 621321205011 GOKUL N
i) Text Box
CO5 C
ii) Label Box
iii) Text Area
Write a Java Program shows the custom exception that we defined for an Integer
CO3 C
value.
12 621321205012 GUNAKAR R
Write a Java Program for suspending, Resuming and Stopping the threads. CO4 C
Illustrate with example for method of Swing Buttons using Applet. CO5 Ap
A palindrome is a word, phrase, number, or other sequence of characters which
reads the same backward or forward.
Given a string, print Yes if it is a palindrome, print No otherwise.
Sample Input 1:
Madam

Sample Output CO3 C


13 621321205013 HARINI A Yes
Sample Input 2:
Java

Sample Output
No
To understate and implement the concepts of Obtaining the Thread's State. CO4 C
Mention the real time example for creating Menus with different methods for
CO5 Ap
menu creation.
Write a Java Program to understand nesting of try and catch blocks CO3 C
Write a Java Program with the concepts of I/O Basics and InputStream and Output
14 621321205014 HARIPRASATH S CO4 C
Stream Reader methods
Write a Java program for JScrollPane and JComboBox CO5 C
We define the following terms:
Lexicographical Order, also known as alphabetic or dictionary order, orders
characters as follows:
A substring of a string is a contiguous block of characters in the string. For
example, the substrings of abc are a, b, c, ab, bc, and abc.
Given a string, s, and an integer,k, complete the function so that it finds the
lexicographically smallest and largest substrings of length k.
Function Description
Complete the getSmallestAndLargest function in the editor below.
getSmallestAndLargest has the following parameters:
string s: a string
int k: the length of the substrings to find CO3 C
Returns string: the string ' + "\n" + ' where and are the two substrings
15 621321205016 HARISH VISHNU K Input Format
The first line contains a string denoting s.
The second line contains an integer denoting k.
Sample Input 0
welcometojava
3

Sample Output 0
ava
wel
Write a Java Program for reading console Input and Writing Console Output CO4 C
An analysis of examination results at a school gave the following distribution of
grades for all subjects taken in one year: A - 10, B - 25, C - 45, D - 20. Write a
CO5 Ap
Java program to represent the distribution of each grade in a pie chart,where each
slice of pie differently colored.
Write a program Program with try and catch & finally block CO3 C
16 621321205017 JANANI E CO4 C
Write a Java Program for implementing the concpts of Reading and Writing files
Write an applet program for displaying the Line, Rectangle and Oval. CO5 C
Write a Java Program to demonstrate the chained exception CO3 C
Write a Java Program to demonstrate the PrintWriter Class CO4 C
17 621321205018 JAWAHAR G
Write an applet program for usage of special fonts for text in Graphics
CO5 C
programming.
Write a program to accept name and age of a person from the command prompt
(passed as arguments when you execute the class) and ensure that the age entered
is >=18 and <60.
Display proper error messages. CO3 C
The program must exist gracefully after displaying the error message in case the
18 621321205019 JONA R
arguments passed are not proper. (Hint: Create a user defined exception class for
handling errors).
Illustrate with example of Life cycle of thread. Write a Java Program to implement
CO4 C
the states of thread.
Write an Applet program to demonstrate the concepts of MVC Connection. CO5 C
Write a Java Program to validate student record using Exception Handling CO3 C
CO4 C
19 621321205020 KANNIKA K Write a Java Program to demonstrate the concepts of File Reader and File Writer
List the layout management and write a Java program for any three layout
CO5 Ap
management.
Write a simple program to prevent creation of second object using Exception
CO3 C
Handling
Write a Java Program to implement the file handling concepts:
i) Create a file name called "Abc.txt".
ii) In that abc.txt file you can write the file about the usage of File Handling
Concepts. CO4 C
20 621321205021 KARTHICK RAJA .S.S
iii) After writing the file now you can read the file "abc.txt" and print the number
of characters
present in the file.
Write a Java Programs for the following Swing Components:
1. Button CO5 C
2. Check Box
Given a string, s, and two indices, start and end, print a substring consisting of all
characters in the inclusive range from start to end -1. You'll find the String class'
substring method helpful in completing this challenge.
Input Format
The first line contains a single string denoting s.
The second line contains two space-separated integers denoting the respective
values of start and end.
CO3 C
Output Format
Print the substring in the inclusive range from start to end-1.
21 621321205022 KATHIRVEL T
Sample Input
Helloworld
37
Sample Output
lowo
Write a Java Program to implement the concpts of BufferedInputStream Reader
CO4 C
and BufferedOutputStream Writer
Construct a program for the concpets of Importing images in Applet and
CO5 Ap
Imageicon using Abstract Window Toolkit
You are given a piece of Java code. You have to complete the code by writing
down the handlers for exceptions thrown by the code. The exceptions the code
may throw along with the handler message are listed below:
Division by zero: Print "Invalid division". CO3 Ap
String parsed to a numeric variable : Print "Format mismatch".
22 621321205023 KEERTHANA R Accessing an invalid index in string : Print "Index is invalid".
Accessing an invalid index in array : Print "Array index is invalid".
Write a Java Program for implementing the concepts of Scanner Class CO4 C
Write a Java Programs for the following Swing Components:
1. Scroll Bar CO5 C
2. Radio Buttons
Write a program that accepts 2 integers a and b as input and finds the quotient of
a/b.
This program may generate an Arithmetic Exception. Use exception handling
mechanisms to handle this exception. In the catch block, print the message as
shown in the sample output.
Also illustrate the use of finally block. Print the message “Inside finally block”.
Sample Input and Output 1:
Enter the 2 numbers:
5 CO3 C
2
23 621321205024 KIRUTHIKA K The quotient of 5/2 = 2
Inside finally block
Sample Input and Output 2:
Enter the 2 numbers:
5
0
DivideByZeroException caught
Inside finally block
Write a Java Program to implementing the file handling concepts and demonstrate
CO4 C
the file closing method
Write a simple program using JScrollPane
CO5 C
Write a simple program using JComboBox.
Write a java program that will check whether a given string is palindrome or not CO3 C
Write a Java Program to creating a thread and implementing the following
24 621321205025 MARUTHU PANDIAN A CO4 C
methods : isAlive() and join()
CO5 Ap
Design a Scientific calculator using event–driven programming paradigm of Java
Given two strings, append them together and return the result.However, if
concatenation creates a double-char, then omit one of the chars. If the inputs are
CO3 C
"Java" and "Programming"then the output should be "Java Programming"(The
Output should be in lowercase)
25 621321205026 MATHIYUGAN R Write a Java Program for Interthread Communication CO4 C
Write an Applet program to implement the following concepts
i) Text Box
CO5 C
ii) Label Box
iii) Text Area
Given two strings, append them together and return the result.However, if
concatenation creates a double-char, then omit one of the chars. If the inputs are
CO3 C
"Java" and "Programming"then the output should be "Java Programming"(The
Output should be in uppercase)
26 621321205027 MOHAMMED AFRITH M Write a Java Program to implement the concepts of following methods
i) NORMAL_PRIORITY
CO4 C
ii) MAX_PRIORITY
iii) MIN_PRIORITY
Write a Applet Program to implement various Event handling methods CO5 C
Given two strings, append them together and return the result.However, if
concatenation creates a double-char, then omit one of the chars. If the inputs are
CO3 C
"Java" and "Programming"then the output should be "Java Programming"(The
Output should be in uppercase of First character and last character)
27 621321205028 MUGILAN.S Write a Java Program to implement the concepts of Thread Priorities CO4 C
Wite a Applet program to implement the following: Create four check boxes. The
initial state of the first box should be in checked state. The status of each check
CO5 C
box should be displayed. When we change the state of a check box, the status
should be displayed is updated.

Write java code to implement exception handling. Use of keywords throw, throws,
try, catch, and finally. Checked and unchecked exceptions. Writecode that deals CO3 C
with both checked and unchecked exceptions. Write custom exception classes by
extending base exception classes from the API.Code using try-with-resources
Write a Java program for printing the following patterns in the output screen.
1. Table for 2
28 621321205029 MUKESH RAJAN N
2. Table for 5 CO4 C
3. Table for 100
By using synchronized methods and blocks.
Write a program to create a frame with the following menus, such that the
corresponding geometric object is created when a menu is clicked.
CO5 C
a. Circle. b. Rectangle.
c. Line. d. Diagonal for the rectangle
Given a string, return a new string made of n copies of the first two chars of the
original string where the length of the string. The string may be any length . If
CO3 C
there are fewer than 2 chars, whatever is there.
If input is "Naveen" then output should be "NaNaNaNaNa"
Write a java application program for generating four threads to perform the
following operations:
29 621321205030 NAVEEN J N
i. Getting N numbers as input
CO4 C
ii. Printing the numbers divisible by 5
iii. Printing the even numbers
iv. Computing Average .
Mention the real time example for creating Menus with different methods for
CO5 Ap
menu creation.
Write a Java Program to create custom exception using Exception Handling CO3 C
Write a Java progam that prints the numbers from 1 to 10 line by line after every
CO4 C
10 seconds.
30 621321205031 NIKITHA VARDHINI V Code a java program to implement the following:
Create four check boxes. The initial state of the first box should be in checked
CO5 C
state. The status of each check box should be displayed. When we change the state
of a check box, the status should be displayed is updated.

Two strings, a and b, are called anagrams if they contain all the same characters in
the same frequencies. For this challenge, the test is not case-sensitive. For
example, the anagrams of CAT are CAT, ACT, tac, TCA, aTC, and CtA.
Function Description
Complete the isAnagram function in the editor.
isAnagram has the following parameters:
• string a: the first string
• string b: the second string
Returns
boolean: If and are case-insensitive anagrams, return true. Otherwise, return false.
Input Format
The first line contains a string a. CO3 C
The second line contains a string b.
Sample Input 0
anagram
margana
31 621321205032 NILANI S
Sample Output 0
Anagrams

Sample Input 1
anagramm
marganaa
Sample Output 1
Not Anagrams
Write a java application program for generating four threads to perform the
following operations:
i. Getting N numbers as input
CO4 C
ii. Printing the numbers divisible by 5
iii. Printing the even numbers
iv. Computing Average .
Write a simple Java program for Event Handlers:
1. Keyboard CO5 C
2. Mouse
Given a string of of Odd length, retuns the first half. So the string "Pooja" yields
CO3 C
Poo. If the string length is even number then return null.
32 621321205033 POOJA S
Write a Java Program for suspending, Resuming and Stopping the threads. CO4 C
Write an Applet program to demonstrate the concepts of MVC Connection. CO5 C
Given a string, return a new string made of n copies of the first two chars of the
original string where the length of the string. The string may be any length . If
CO3 C
there are fewer than 2 chars, whatever is there.
If input is "Poornika" then output should be "PooPooPooPooPoo"
Write a Java program for printing the following patterns in the output screen.
33 621321205034 POORNIKA M 1. Table for 2
2. Table for 5 CO4 C
3. Table for 100
By using synchronized methods and blocks.
Write an applet program for usage of special fonts for text in Graphics
CO5 C
programming.
Given a string of of even length, retuns the first half. So the string "Ragavan"
CO3 C
yields Raga. If the string length is Odd number then return null.
Write a Java Program to implement the file handling concepts:
i) Create a file name called "Abc.txt".
ii) In that abc.txt file you can write the file about the usage of File Handling
34 621321205036 RAGAVAN M Concepts. CO4 C
iii) After writing the file now you can read the file "abc.txt" and print the number
of characters
present in the file.
Construct a program for the concpets of Importing images in Applet and
CO5 Ap
Imageicon using Abstract Window Toolkit
Given a string, return a version without the first and last character, so
CO3 C
"Ragavendran" yields "agavendra". The string length will be atleast 2.
CO4 C
Write a Java Program to demonstrate the creation of thread using extends Applet
35 621321205037 RAGAVENDRAN S
Code a java program to implement the following:
Create four check boxes. The initial state of the first box should be in checked
CO5 C
state. The status of each check box should be displayed. When we change the state
of a check box, the status should be displayed is updated.
Given a string, return a version without the first character, so "Rajesh" yields
CO3 C
"ajesh". The string length will be atleast 2.
36 621321205038 RAJESH K S CO4 C
Write a Java Program to demonstrate the concepts of File Reader and File Writer
Write a Java Program and returned by the getGraphics( ) method of Component(all
CO5 C
methods).
Given two strings a and b, return a string of the form short + long + short
with the shorter string on the outside and the longer string on the inside. CO3 C
The strings will not be the same length, but may the empty. If the input
"hi" and "Ramakrishnan", then output will be "hiRamakrishnanhi".
Write a Java Program to implement the file handling concepts:
37 621321205039 RAMAKRISHNAN R i) Create a file name called "Abc.txt".
ii) In that abc.txt file you can write the file about the usage of File Handling
Concepts. CO4 C
iii) After writing the file now you can read the file "abc.txt" and print the number
of characters
present in the file.
Write a Applet Program to implements the methods of working with 2D shapes. CO5 C
Given two strings a and b, return a string of the form short + long + short
with the shorter string on the outside and the longer string on the inside.
CO3 C
The strings will not be the same length, but may the empty. If the input
"hi" and "Ramya" and "Hello, then output will be "hiRamyaHello".
Write a Java Program to implement the concepts of following methods
38 621321205040 RAMYADHARSHINI D
i) NORMAL_PRIORITY
CO4 C
ii) MAX_PRIORITY
iii) MIN_PRIORITY
Write a Applet Program to implements the methods of working with color,font
CO5 C
and images.
Given a string, if the first or last characters are 'x' return the string without those 'x'
character and otherwise return the string unchanged.
Sample Input and Output 1:
Input: xRasidha Begumx
CO3 C
Output: Rasidha Begum
Sample Input and Output 2:
Input: Rasidha Begum
Output: Rasidha Begum

Create a menu based Java application with the following options.


1. Add an Employee
2. Display All
3. Exit
If option 1 is selected, the application should gather details of the employee like
employee name, employee id, designation and salary and store it in a file.
If option 2 is selected, the application should display all the employee details.
If option 3 is selected the application should exit.
39 621321205041 RASIDHA BEGUM A Sample Output:
Main Menu
1. Add an Employee
2. Display All
CO4 C
3. Exit
1
Enter Employee ID: 120
Enter Employee Name: Sudhir
Enter Employee Age: 33
Enter Employee Salary: 90000
Main Menu
1. Add an Employee
2. Display All
3. Exit
2
----Report-----
120 Sudhir 33 90000.0
130 Selvan 40 100000.0
----End of Report-----
Write a Applet program to implement the concepts of fonts CO5 C
Given a string, if the characters are 'i' return the string without those 'i' character
and otherwise return the string unchanged.
Sample Input and Output 1:
Input: Rasiniya
CO3 C
Output: Rasnya
40 621321205042 RASINIYA A Sample Input and Output 2:
Input: Program
Output: Program
Write a Java Program for Interthread Communication CO4 C
Illustrate with example of MVC Architectecture and write a program to create
CO5 Ap
application for class
Given two strings, word and a separator, returns a big string made of count
occurrences of the word, separated by separate string.
CO3 C
If the inputs are "Rima", "NP" and 3 then the output is
"RimaNPRimaNPRimaNP".
Write a Java program for printing the following patterns in the output screen.
1. Table for 2
2. Table for 5 CO4 C
41 621321205043 RIMA N P
3. Table for 100
By using synchronized methods and blocks.

Write an Applet program to implement the following concepts in Event Handling:


i) Events CO5 C
ii) Events Source
iii) Listeners
Given two strings, word and a separator, returns a big string made of count
occurrences of the word, separated by separate string.
CO3 C
If the inputs are "Risen", "Bright" and 4 then the output is
"RisenBrightRisenBrightRisenBrightRisenBright".
Write a java application program for generating four threads to perform the
following operations:
42 621321205044 RISEN BRIGHT.A
i. Getting N numbers as input
CO4 C
ii. Printing the numbers divisible by 5
iii. Printing the even numbers
iv. Computing Average .
Write a Simple program to demonstrate the concept of Mouse Events in event
CO5 C
handling
Return a version of of the given string, where for every star(*) in the string the star
and the characters immediately to its left and right are gone. So "RI*TH" yields CO3 C
43 621321205045 RITHIKSHA D RH and "RITH**IKSHA" also yields RA.
Wite a Java Program to demonstrate the different ways of creating thread. CO4 C
Java program for handling keyboard events. CO5 C
Given two strings a and b create a bigger string made of the first character of a,
first character of b,the second character of a, second character of b and so on. Any
CO3 C
leftover characters fo at the end of the result.
If the inputs are "Hello" and "World", then the output is "HWeolrllod".
44 621321205046 SANDHIYA M
CO4 C
Write a Java Program to demonstrate the creation of thread using extends Applet
To create simple awt program by using
i) By extending Frame class(inheritance) CO5 C
ii) By creating the object of Frame class(association)
Given two strings a and b create a bigger string made of the first character of a,
first character of b,the second character of a, second character of b and so on. Any
leftover characters fo at the end of the result. CO3 C
If the inputs are "HiHelloo" and "Sandhiya", then the output is
"HSiaHnedlhlioyoa".
Write a Java program for printing the following patterns in the output screen.
45 621321205047 SANDHIYA S 1. Table for 2
2. Table for 5 CO4 C
3. Table for 100
By using synchronized methods and blocks.
Write a simple program to implement
i) program for Swing by Association inside constructor CO5 C
ii) program for Swing byinheritance
Given two strings a and b create a bigger string made of the first character of a,
first character of b,tha second character of a, second character of b and so on. Any
rightover characters fo at the end of the result. CO3 C
If the inputs are "HiHelloo" and "Santhosh", then the output is
46 621321205048 SANTHOSH M
"ShainHtehlolsoho".
CO4 C
Write a Java Program to demonstrate the creation of thread using extends Applet
To create simple AWT program by using Layout management CO5 Ap
Given a string and an int n, return a string made of n repetitions of the last n
characters of the string. You may assume that n is between 0 and its length of the
CO3 C
string inclusive.For example if the inputs are "Santhosh" and 3 then the output
should be "oshoshosh".
47 621321205049 SANTHOSH S Write a Java Program to implement the concepts of following methods
i) NORMAL_PRIORITY
CO4 C
ii) MAX_PRIORITY
iii) MIN_PRIORITY
To create simple AWT program for Java GridLayout CO5 Ap
Given a string and an int n, return a string made of n repetitions of the last n
characters of the string. You may assume that n is between 0 and its length of the
CO3 C
string inclusive.For example if the inputs are "Santhosh Kumar" and 3 then the
48 621321205050 SANTHOSH KUMAR S output should be "KumarKumarKumar".
Illustrate with example of Life cycle of thread. Write a Java Program to implement
CO4 Ap
the states of thread.
To create simple AWT program for Java FowLayout CO5 Ap
Given a string and a non empty word string, return a string made of each character
just before and just after every appearance of the word in the string. Ignore cases
where there is no character before or after the word, and a character may be
include twice if it is between two words. CO3 C
If the inputs are "abcXY123XYijk" and XY, the output will be "c13i"
If the inputs are "XY123XY" and "XY" output should be "13"
If the inputs are "XY1XY" and "XY" output should be "11".
49 621321205051 SHAHIN ABDUL RAZACK T
Write a java application program for generating four threads to perform the
following operations:
i. Getting N numbers as input
CO4 C
ii. Printing the numbers divisible by 5
iii. Printing the even numbers
iv. Computing Average .
To create simple AWT program for Java BoxLayout CO5 Ap
Given a string, s, matching the regular expression [A-Za-z !,?._'@]+, split the
string into tokens. We define a token to be one or more consecutive English
alphabetic letters. Then, print the number of tokens, followed by each token on a
new line.
Note: You may find the String.split method helpful in completing this challenge.
Input Format
A single string, s.
Output Format

On the first line, print an integer, n, denoting the number of tokens in string s (they
do not need to be unique). Next, print each of the n tokens on a new line in the
same order as they appear in input string s. CO3 C
50 621321205052 SHALINI.S Sample Input:
I am a Java Programmer, why not you?
Sample Output:
8
I
am
a
Java
Programmer
why
not
you
CO4 Ap
Create a Bank database application program to illustrate the use of multithreading.
To create simple AWT program for Java CardLayout CO5 Ap
Given a string, s, and two indices, start and end, print a substring consisting of all
characters in the inclusive range from start to end -1. You'll find the String class'
substring method helpful in completing this challenge.
Input Format
The first line contains a single string denoting s.
The second line contains two space-separated integers denoting the respective
values of start and end.
CO3 C
Output Format
51 621321205053 SHIVAANI M Print the substring in the inclusive range from start to end-1.
Sample Input
Helloworld
37
Sample Output
lowo
Write a java program for banking application to illustrate the usage of thread
CO4 C
synchronized keyword and inter thread communication process.
Write a Java program that copies the content of one file to another using Input and
CO5 C
Output classes.
Type the program above and compile. Run and enter an integer between 1 and 10.
The program is requesting a number between 1 and 10. Run the program again and
enter 5.5. Although this number is between 1 and 10, the program will abort.
Examine the error message. You should see the word Exception, the method
where the exception occurred (main), the class name of the exception
(InputMismatchException), as well as the call stack listing the method calls.
Add a try/catch block to catch and handle the InputMismatchException exception.
Identify the statements that cause the error as well as the portions of the program
that depend upon these statements. Enclose these statements within the try block.
Follow the try block with the catch block given below. Note, the
InputMismatchException class is defined in java.util and must be imported. Also, CO3 C
when the Scanner throws an InputMismatchException, the input token will remain
in the buffer so that it can be examined by the program. In our case, we will not
52 621321205054 SIVA HARISH R be examining the token, but will simply clear out of the buffer to start over.
catch (InputMismatchException ime) {

System.out.println("Enter whole numbers only, with no spaces or other


characters");
scan.next(); // clear the scanner buffer
}
Compile and run the program again, testing with a variety of input (integers,
floats, characters) The program should not abort when floats or character data is
given.
Write a Java program for printing the following patterns in the output screen.
1. Table for 2
2. Table for 5 CO4 C
3. Table for 100
By using synchronized methods and blocks.
To create simple AWT program for Java GridBagLayout CO5 Ap
Write a Java Program to Develop application using Built-in Exception CO3 C
53 621321205055 SIVANESAN.M Write a Java Program for suspending, Resuming and Stopping the threads. CO4 C
To create simple AWT program for Java GroupLayout CO5 Ap
Write a program to determine the methods that are available in StringBuffer CO3 C
This is a simple project which involves creation of multiple threads and explores
some thread control mechanisms and thread priorities.
a. Create two threads named ‘Hare’ and ‘Tortoise’. The threads created should run
100 meters and the thread which finishes first ‘wins the race’. When one of the
54 621321205056 SUNIL SANTHOSH S threads wins the race, stop the second thread.Start both the threads and observe
CO4 C
which thread finishes first.
b. Since the Hare is faster than Tortoise, set a high priority to Hare thread and
observe the results.
c. Now modify the program so that the ‘Hare’ thread ‘sleeps’ for 1000
milliseconds after running 60 meters. Observe which thread wins the race
To create simple AWT program for Java SpringLayout CO5 Ap
Write a Java Program to implement user defined exception handling. CO3 C
Illustrate with example of Life cycle of thread. Write a Java Program to implement
55 621321205057 TAMIZH SELVAN K CO4 C
the states of thread.
To create simple AWT program for Java ScrollPaneLayout CO5 Ap
Write an exception class for a time of day that can accept only 24 hour
representation of clock hours. Write a Java program to input various formats of CO3 C
timings and throw suitable error messages.
56 621321205058 TRISHA M
Write a java program for banking application to illustrate the usage of thread
CO4 C
synchronized keyword and inter thread communication process.
To create simple AWT program for Swing TextArea Component CO5 Ap
Write a program to take care of Number Format Exception if user enters values
other than integer for calculating average marks of 2 students. The name of the
students and marks in 3 subjects are taken from the user while executing the
CO3 C
program.
57 621321205059 UMAR FAROOK. M
In the same program write your own Exception classes to take care of negative
values and values out of range.
List and explain about classes used in Charater Stream. CO4 Ap
To create simple AWT program for Swing Jdialog CO5 Ap
Write a Java program that includes a throw block and throws clause which posses
CO3 C
the exception.
58 621321205060 VIGNESH P
Write a Java Program to implement File Handling using IO streams CO4 C
To create simple AWT program for Swing TextField CO5 Ap
Write a Java Program to create custom exception using Exception Handling CO3 C
Write a java application program for generating four threads to perform the
following operations:
i. Getting N numbers as input
59 621321205061 VIGNESH V CO4 C
ii. Printing the numbers divisible by 3
iii. Printing the Odd numbers
iv. Computing Average
To create simple AWT program for Swing JButton CO5 Ap
Given a string, s, and two indices, start and end, print a substring consisting of all
characters in the inclusive range from start to end -1. You'll find the String class'
substring method helpful in completing this challenge.
Input Format
The first line contains a single string denoting s.
The second line contains two space-separated integers denoting the respective
values of start and end.
CO3 C
Output Format
Print the substring in the inclusive range from start to end-1.
Sample Input
60 621321205062 VISHAL.S
Helloworld
37
Sample Output
lowo
Write a Java program for printing the following patterns in the output screen.
1. Table for 2
2. Table for 5 CO4 C
3. Table for 100
By using synchronized methods and blocks.
To create simple AWT program for Swing JCheckBox CO5 Ap
Given a string and a non empty word string, return a string made of each character
just before and just after every appearance of the word in the string. Ignore cases
where there is no character before or after the word, and a character may be
include twice if it is between two words. CO3 C
If the inputs are "abcXY123XYijk" and XY, the output will be "c13i"
If the inputs are "XY123XY" and "XY" output should be "13"
If the inputs are "XY1XY" and "XY" output should be "11".
61 621321205063 VISHWA K
Write a java application program for generating four threads to perform the
following operations:
i. Getting N numbers as input
CO4 C
ii. Printing the numbers divisible by 5
iii. Printing the even numbers
iv. Computing Average .
To create simple AWT program for Swing JRadioButton CO5 Ap
Write a Java Program by using Multiple Catch Statements CO3 C
62 2022LIT01 PRAVEEN P Write a Java Program for suspending, Resuming and Stopping the threads. C
To create simple AWT program for Swing Jlist CO5 Ap
Write a Java program for bulit in exceptions using Number Format Exception CO3 C
Write a Java progam that prints the numbers from 1 to 10 line by line after every
63 2022LIT002 HARIHARAN M CO4 C
10 seconds.
To create simple AWT program for Java AWT Choice menu. CO5 C
Write a Java program that includes a try block and catch clause which posses the
CO3 C
arithmetic exception.
This is a simple project which involves creation of multiple threads and explores
some thread control mechanisms and thread priorities.
a. Create two threads named ‘Hare’ and ‘Tortoise’. The threads created should run
100 meters and the thread which finishes first ‘wins the race’. When one of the
64 2022LIT003 DHANUSH R threads wins the race, stop the second thread.Start both the threads and observe
CO4 Ap
which thread finishes first.
b. Since the Hare is faster than Tortoise, set a high priority to Hare thread and
observe the results.
c. Now modify the program so that the ‘Hare’ thread ‘sleeps’ for 1000
milliseconds after running 60 meters. Observe which thread wins the race
To create simple AWT program for Java AWT JScrollBar CO5 C
Write a Java program that includes a try block and catch clause which posses the
CO3 C
arithmetic exception generated by divide by zero.
65 2022LIT004 KAVIRAJ D
Write a Java program for Reading Console Input. CO4 C
To create simple AWT program for Java AWT Jwindow CO5 C
Java program to display the given string in both uppercase and lowercase CO3 C
Create a thread by extending the Thread class. Also make use of constructor and
66 2022LIT005 LOGANATHAN S CO4 Ap
display message "Welcome to World".
To create simple AWT program for Java AWT JMenuBar CO5 Ap
Java program to display the given string in reverse manner C03 C
Write a Java progam that prints the numbers from 1 to 10 line by line after every
67 2022LIT006 PRASANNA G CO4 C
10 seconds.
To create simple AWT program for Java AWTJMenuItem and Jmenu CO5 Ap
Blooms Level:
C - Creating E - Evaluating A - Analyzing Ap - Applying U - Understanding R - Remembering

FACULTY INCHARGE HOD

You might also like