You are on page 1of 9

ANNA UNIVERSITY: CHENNAI-600 025 B.E/B.TECH DEGREE EXAMINATIONS, OCT/NOV. 2013 Regulations -2008 Fifth Semester B.

TECH INFORMATION TECHNOLOGY IT2305 JAVA PROGRAMMING LAB

TIME: 3 HOURS

MARKS: 100

1. a. Develop a java program to sort an array of N numbers in ascending order. (40)

b. Develop a java program for implementing a queue data structure using linked list. Perform the following operations: i. ii. Insert an element Delete an element (50)

c. Viva- Voce 10 marks

2. a. Develop a java program to sort an array of N names alphabetically.

(40)

b. Develop a java program for implementing a stack data structure using linked list. Perform push and pop operations. (50)

c. Viva- Voce 10 marks

3. a. Develop a java program to perform linear search on an array of N numbers. (40)

b. Develop a java program for implementing a stack data structure using linked list. Perform push and pop operations. (50)

c. Viva- Voce 10 marks

4. a. Develop a java program to perform binary search on a sorted array of N numbers. (40)

b. Develop a java program for implementing a singly linked list data structure. Perform the following operations: i. ii. Insert a node Delete a node (50)

c. Viva- Voce 10 marks

5. a. Develop a java program to sort an array of N names alphabetically.

(40)

b. Develop a java program for implementing a queue data structure using linked list. Perform the following operations: i. ii. Insert an element Delete an element (50)

c. Viva- Voce 10 marks

6. a. Develop a java program to perform binary search on a sorted array of N numbers. (40)

b. Develop a java program for implementing a singly linked list data structure. Perform the following operations: i. ii. Insert a node Delete a node (50)

c. Viva- Voce 10 marks

7. a. Develop a java program to perform the following:

(40)

Define a class named COMPLEX for representing complex numbers that contains necessary data members and member functions. A complex number

has the general form a + ib, where a is the real part and b is the imaginary part (i stands for imaginary). Include methods for all the four basic arithmetic operators.

b. Develop a java program to copy the contents of one file in to another.

(50)

c. Viva- Voce 10 marks

8. a. Develop a java program to find the greatest of N numbers.

(40)

b. Develop a Java program to define a class called Account which contains two private data elements, an integer account number and a floating point account balance, and three methods: (50)

A constructor that allows the user to set initial values for account number and account balance and a default constructor that prompts for the input of the values for the above data members. A method which reads a character value for transaction type (D for deposit and W for withdrawal), and a floating point value for transaction amount, and updates account balance. A method, which prints on the screen the account number and account balance.

c. Viva- Voce 10 marks

9. a. Develop a java program to perform the following: Define a class to represent a bank account. Include the following: Data members: Name of the depositor Account number Type of account Balance amount in the account Member functions: To assign initial values To deposit an amount To withdraw an amount after checking the balance To display account number, name and balance

(40)

b. Develop a java program to copy the contents of one file in to another.

(50)

c. Viva- Voce 10 marks

10. a. Develop a java program to perform the following:

(40)

Define a class named COMPLEX for representing complex numbers that contains necessary data members and member functions. A complex number

has the general form a + ib, where a is the real part and b is the imaginary part (i stands for imaginary). Include methods for all the four basic arithmetic operators.

b. Develop a java program using files to prepare a mark list for ten students. The input is Roll Number, Name, Mathematics Mark, Physics Mark and Chemistry Mark. Compute Total and Average. The report should be presented in the following format: (50)

Roll Number

Name

Mathematics Mark

Physics Mark

Chemistry Mark

Total

Average

c. Viva- Voce 10 marks

11. a. Develop a java program using interfaces to implement a stack ADT.

(50)

b. Develop a java program to add two matrices.

(40)

c. Viva- Voce 10 marks

12. a. Develop a java program using applets that can draw basic graphical primitives in different dimensions and colors. Use appropriate menus and buttons. (90)

b. Viva- Voce 10 marks

13. a. Develop a java program for a scientific calculator.

(90)

b. Viva- Voce 10 marks

14. a. Develop a java program using templates for implementing a linked list data structure and perform basic operations on the linked list. (40)

b. Develop a java program using interfaces to implement a stack ADT.

(50)

c. Viva- Voce 10 marks

15. a. Develop a multi threaded program in java for the producer consumer application. (60)

b. Develop a java program to find the transpose of a matrix.

(40)

c. Viva- Voce 10 marks

16. a. Develop a Java program for generating two threads to perform the following operations: Generate first n prime numbers Generate first n Fibonacci numbers (45)

b. Develop a Java program that creates a string object and initializes it with your name and performs the following operations: (45)

Find the length of the string object using appropriate string method. Find whether the character a is present in the string. If yes find the number of times a appears in the name and the location where it appears.

c. Viva- Voce 10 marks

17. a. Develop a Java program for generating three threads to perform the following operations: Accept N numbers Print the even numbers Print the odd numbers (45)

b. Develop a Java program to find the number of occurrences of a given word in a paragraph. (45)

c. Viva- Voce 10 marks

18. a. Develop a java program that will create a data file containing the list of employees in the following table: Employee Number 123 124 Hamen Vippin Assistant Professor Professor Name Designation

Perform search operation.

(45)

b. Develop a java program to accept a paragraph, print each word in the paragraph with the number of vowels in each word. (45)

c. Viva- Voce 10 marks

********

You might also like