R 20 Regulations, B.
Tech Civil Engineering
SOFT SKILLS COURSE L T P C
IV Year-I Semester JAVA 1 0 2 2
(SS4101)
Course Objectives:
1. To teach the students basics of JAVA programs and its execution.
2. To teach the students the differences between C++ and Java programming.
3. To make the students learn concepts like packages and interfaces.
4. To make the students understand life cycle of the applets and its functionality.
5. To make the students understand the usage util package.
6. To teach the student, to develop java programs using interfaces.
Course Outcomes:
By the end of the course, the student will be able to
1. Able to use Java compiler and eclipse platform to write and execute java program.
2. Understand and Apply Object oriented features and Java concepts.
3. Able to apply the concept of multithreading and implement exception handling.
4. Able to access data from a Database with java program.
5. Develop applications using Console I/O and File I/O,GUI applications.
Course Articulation Matrix:
CO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3
CO1 - - 2 1 2 - - - - - - 1 - - -
CO2 - - 2 1 2 - - - - - - 1 - - -
CO3 - - 2 1 2 - - - - - - 1 - - -
CO4 - - 2 1 2 - - - - - - 1 - - -
CO5 - - 2 1 2 - - - - - - 1 - - -
List of Exercises:
1. Use eclipse or Netbean platform and acquaint with the various menus, create a test project,
add a test class and run it see how you can use auto suggestions, auto fill. Try code formatter
and code refactoring like renaming variables, methods and classes. Try debug step by step
with a small program of about 10 to 15 lines which contains at least one if else condition and
a for loop.
2. Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons
for the digits and for the +, -,*, % operations. Add a text field to display the result. Handle any
possible exceptions like divide by zero.
3.
a) Develop an applet that displays a simple message.
b) Develop an Applet that receives an integer in one text field & compute its factorial value &
returns it in another text filed when the button ―Compute‖ is clicked
4. Write a program that creates a user interface to perform integer divisions. The user enters
two numbers in the text fields, Num1 and Num2. The division of Num1 and Num2 is displayed
in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer,
the program would throw a Number Format Exception. If Num2 were Zero, the program would
throw an Arithmetic Exception Display the exception in a message dialog box
R 20 Regulations, B. Tech Civil Engineering
5. Write a java program that implements a multi-thread application that has three threads. First
thread generates random integer every 1 second and if the value is even, second thread computes
the square of the number and prints. If the value is odd, the third thread will print the value of
cube of the number.
6. Write a java program that connects to a database using JDBC and does add, deletes, modify and
retrieve operations.
7. Write a java program that simulates a traffic light. The program lets the user select one of three
lights: red, yellow, or green with radio buttons. On selecting a button, an appropriate message
with ―stop‖ or ―ready‖ or ―go‖ should appear above the buttons in a selected color. Initially there
is no message shown.
8. Write a java program to create an abstract class named Shape that contains two integers and an
empty method named printArea(). Provide three classes named Rectangle, Triangle and Circle
such that each one of the classes extends the class Shape. Each one of the classes contain only the
method printArea( ) that prints the area of the given shape.
9. Suppose that a table named Table.txt is stored in a text file. The first line in the file header and
the remaining lines correspond to row in the table. The elements are separated by commas. Write
a Java program to display the table using labels in grid layout.
10. Write a Java program that handles all mouse events and shows the event name at the center of
the window when a mouse event is fired. (Use adapter classes)
Reference Books:
1. Jason Hunter, William Crawford, Java Servlet Programming, Second Edition, ,O'Reilly
Media
2. Hans Bergsten, Java Server Pages, O‘Reilly
3. http://www.oracle.com/technetwork/java/index-jsp-135475.html
4. http://www.oracle.com/technetwork/java/javaee/jsp/index.htm