Sie sind auf Seite 1von 1

NOTICE

Attn: Students of BE(CSE/IT) V Semester ASSIGNMENT 1 Q1. Design and Implement an Array class with following specifications Data Members Type : Float Data Members Size : Tobe defined at run-time. Initialization : Numbers defined at the time of instantiation (ZERO by default). Operation : Get():Input Array. Get(position,number):Input Array element number at position. Put():Display Array. Put(position,number):Displsy Array element number at position. Extract(): Returns the Element stored at given location. Q2. Extend the class Array to improve functionality such as Maximum(), Average(), Sort(), Search(), PutUniqueOnly(), Q3. A 2-D array can be defined as array of arrays, extend the class Array to implement class Matrix. Q4. Design and Implement an abstract class shape having two int data members, constructors and an abstract method disparea(). Derive classes rectangle and triangle from shape class which include appropriate constructors and implement disparea() methods. Create objects of Derived classes rectangle and triangle classes and demonstrate their disparea() methods. Q5. Write a Java Application to create an interface to enter a two numbers in two text fields and display their sum in the third text field when you pressed the Add button. Q6. Develop a Java Application with a Text Field, a Text Area and button show. User is supposed to enter the name of the file in the Text Field. After pressing the SUBMIT button, the contents of the file should be displayed in the Text Area. An exception is expected to be raised if the file doesnt exist. Q7. Write a Java application that reads N integers from keyboard and display the average of N integer. Application should generate an exception if data is not in integer format. If number is not between 0 and 100 then Application should generate a Customize Exception with proper message. After Exception generated by application, program continue to read the next number. Do not count the exception iteration. Q8. Write a JAVA program to generate three different threads using a Main thread. All child thread generates a series of numbers as per followings. Thread1: 1...50 Thread2: 200...250 Thread3: 400...450 a. Display them and store them in a common array as they are generated, and observe the nondeterministic behavior of order of output. b. Maintain synchronization among thread when they are executed in such a way that at a time 5 numbers are generated through a thread and the next thread is executed, this process is repeated in round robin method. And Display them and store them in a common array as they are generated, and observe the behavior of order of output to confirm the synchronization.

Das könnte Ihnen auch gefallen