CS2309 SET1.pdf

download CS2309 SET1.pdf

of 6

Transcript of CS2309 SET1.pdf

  • 8/10/2019 CS2309 SET1.pdf

    1/6

    ANNA UNIVERSITY:CHENNAI-600 025

    B.E/B.TECH DEGREE EXAMINATIONS, OCT/NOV. 2013

    Regulations 2008

    Fifth Semester

    B.E COMPUTER SCIENCE AND ENGINEERING

    CS2309 JAVA LAB

    Time: 3 Hours Maximum Marks:100

    1.

    a)Create customer database and write query to add new customer ,update customer details,

    display customers and add credit points to the customer based on their purchase

    amount.(70)

    b)Write a program to find the palindrome of the given string using stack.(30)

    2.

    a)Create Employee database and write query to add new Employee ,update Employeedetails and display pay roll information of an employee based on employeeID.(70)

    b)Write a program to find the first occurence of a string in the given text.(30)

    3. a)Create BOOK database and write query to add new author ,update author details and

    display book details based on author name or ISBN or title.(70)

    b)Write a program to count the number of times the word is repeated in the string.(30)

  • 8/10/2019 CS2309 SET1.pdf

    2/6

    4. a)Write a program to read a file and encrypt the data in the file while writing it to another

    file.(70)

    b)Write a program to perform insert and delete records for the student class.(30)

    5. a)Write a program to merge two files in to a third file.(70)

    b)Write a program to define employee class and show how the data can be hided and

    accessed.(30)

    6. a)Write a program to write an array of student objects in to a file and display the student

    information in the screen based on their register number from the file. (70)

    b)Write a program to add two 3 X3 matrices and to return the resultant matrix to the

    calling method.(30)

    7. a)Write a program to write an array of student objects in to a file and to append the student

    information to the same file.(70)

    b) Write a method to compute the sum of this geometric progression:(30)

    1+x+x2+x

    3+.+x

    n

  • 8/10/2019 CS2309 SET1.pdf

    3/6

    8. a)Write a program to read a file and to edit the record of a particular student.(70)

    b)Write a program to set the thread priority and check thread priority level.(30)

    9. a)Write a program to write the student record in to a file and to delete the record of a

    particular student.(70)

    (b) Write a program to sort N numbers.(30)

    10.a)Write a Time to read, add, subtract and display time. Time must be defined using hours,

    minutes and seconds.(50)

    (b)Write a program to solve the producer and consumer problem using thread.(50)

    11.a)Write a Distance class to read, add, subtract and display distances. Distance must be

    defined using kilometers and meters.(50)

    (b)Write a program to create an array of employee object. Write method to create employee

    record and throw exception for an invalid email("@") and mobile number.(50)

  • 8/10/2019 CS2309 SET1.pdf

    4/6

    12.a)Write a program to use a player class and provide the following.(70)

    (i)Display players based on the tournament name.(ii)Display the list of tournaments played by a player

    (iii)Sort players based on their scores earned.

    (iv)Assign and remove players to the tournament

    b) Write a program to display text with 3 different colors and styles.(30)

    13.Create a class student. Inherit that into engineering, arts, commerce and science students.

    Inherit science student into UG and PG and further subdivided into computer science,

    electronics and communication and mechanical. Provide methods for enrolment,

    examination result processing and granting degree to the students.(100)

    14.a)Develop a simple Ticket reservation system using multi-threading. when you make a

    ticket reservation you first check that seats are available and then you create a reservation,

    then update the number of available seats. Two users that make reservations simultaneously

    must not interfere with each other.(70)

    b) Write a program to encrypt and decrypt a message entered by the user.(30)

    15.a)Create a Bill class for a supermarket. The bill objects contain bill number, item name

    with quantity and price , clerk name and total amount. Create a class that contain price for

    each item. The price of an item is to picked from the class. The items in the bill are varying

    i.e. 1 to 30.(60)

    b) Write a program to change the color of the ball when the user clicks the ball using

    mouse.(40)

  • 8/10/2019 CS2309 SET1.pdf

    5/6

    16.a)Create a complex number class. overload the +, - , ++ and -- operator on the real and

    imaginary part of the complex number.(50)

    b) Write a java program to simulate server-client communication using threads.(50)

    17.a)Write a stack class and overload the +(push) and -(pop) operation.(50)

    b) Write a program that creates the button , label (to display greeting) and listener class for

    a button that displays one of 10 randomly selected greetings.(50)

    18.a)Design a Shape class hierarchy and write a test program to demonstrate

    polymorphism.(60)

    b)Write a java program to change the shapes of the object by pressing the button.(40)

    19.Design a java interface for ADT queue. Develop classes that implement this interface using

    array and linked list. Throw exception if the Queue is empty().(100)

    20.a) Write a program to create online bank access. The features includes create

    account, credit amount, debit amount, check balance, throw exception on debit when

    balance crosses zero. (50)

    b)Write a program to handle events for a calculator with the following buttons i)add

    ii)subtract iii)multiply.(50)

  • 8/10/2019 CS2309 SET1.pdf

    6/6