25
Gujarat Technological University Master of Computer Applications Subject Name: Programming skills IV (Java) Subject Code: 2630006 1. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following classes 1. A class named Student which stores information like the roll number, first name, middle name, last name, address and age of the student. The class should also contain appropriate get and set methods. 05 2. A class named AddStudentFrame which displays a frame consisting of appropriate controls to enter the details of a student and store these details in the Student class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”. 05 3. A class named MyCustomListener which should work as a user defined event listener to handle required events as mentioned in following points. 05 B The “Add record” button should add the record entered in the frame controls to a pre defined file. 10 C Provide a menu on the AddStudentFrame which has menu items titled, “Set the record file” and “Exit”. 05 1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records. 05 2. When the “Exit” menu item is clicked, the frame should be closed. 05 [Note: Use the MyCustomListener class only to handle the appropriate events] D 1. The “Search record” button should open a new frame which should take input of search criteria using a radio button. The radio button should provide facility to search on basis of first name, middle name or last name. 10 2. The new frame should also have a text box to input the search criteria value. 10 3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre defined file which consists all saved records] 10 [Note: Use the MyCustomListener class only to handle the appropriate events] E Provide proper error messages and perform appropriate exceptions where ever required in all the classes 10

Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

Gujarat Technological University Master of Computer Applications

Subject Name: Programming skills – IV (Java) Subject Code: 2630006

1. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Student which stores information like the roll number, first name, middle name, last name, address and age of the student. The class should also contain appropriate get and set methods.

05

2. A class named AddStudentFrame which displays a frame consisting of appropriate controls to enter the details of a student and store these details in the Student class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame

controls to a pre – defined file. 10

C Provide a menu on the AddStudentFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

D 1. The “Search record” button should open a new frame which should

take input of search criteria using a radio button. The radio button should provide facility to search on basis of first name, middle name or last name.

10

2. The new frame should also have a text box to input the search criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 2: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

2. Write a JAVA program which performs the following listed operations: A. Create a package named MyEmpPackage which consists of

following classes

1. A class named Employee which stores information like the Emp number, first name, middle name, last name, address, designation and salary. The class should also contain appropriate get and set methods.

05

2. A class named AddEmployeeFrame which displays a frame consisting of appropriate controls to enter the details of a Employee and store these details in the Employee class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the

appropriate events]

C 1. The “Delete Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of first name, middle name or last name.

10

2. The new frame should also have a text box to input the delete criteria value.

10

3. The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully Deleted”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 3: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

3. Write a JAVA program which performs the following listed operations: A. Create a package named MyDataPackage which consists of

following classes

1. A class named Person which stores information like first name, middle name, last name, address, phone no.

05

2. A class named Student which inherits Person class. Also add information like Institute name, degree. The class should also contain appropriate get and set methods.

3. A class named Employee which inherits Person class. Also add information like Designation and salary. The class should also contain appropriate get and set methods.

05

05

4. A class named AddDataFrame which displays a frame consisting of appropriate controls to enter the details of a Student and Employee and store these details in the Student and Employee class object. The frame should also have three buttons with the caption as “Add Record” and “View Record” and “Exit”.

5. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “View Record” button should open a new frame which should

take input of View criteria using a radio button. The radio button should provide facility of Student and Employee.

10

2. Based on the selection of Student or Employee the new frame should also have a text box to input the View criteria value Employee or Student name.

10

3. The view result should be displayed in a proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions where ever required in all the classes

10

Page 4: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

4. Write a JAVA program which performs the following listed operations: A. Create a package named MyCirclePackage which consists of

following classes

1. A class named Circle which stores information like radius, final variable PHI. The class should contain final methods like Area and Circumference.

10

2. A class named Cylinder which inherits Circle class. Also add information like height. The class should also contain parameterized constructor named Cylinder (radius,height). Call the parent class constructor using this constructor. The class should also contain methods like Surface and Volume. The method Surface() should over ride the Circumference() of the super class. The method Volume() should override the Area() of the super class.

10

3. A class named AddCircleFrame which displays a frame consisting of appropriate controls to enter the details of a radius and height and store these details in the Cylinder class object. The frame should

also have four buttons with the caption as “Calculate Surface” and “Calculate Volume” and “Exit” and ”View Result”.

4. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

05

B 1. When the “Calculate Surface” button is clicked, then the surface of

the cylinder should be calculated and stored in the file and a dialog box should be appeared with the calculated surface and with the message “The surface area is: “.

2. When the “Calculate Volume” button is clicked, then the volume of the cylinder should be calculated and stored in the file and a dialog box should be appeared with the calculated surface and with the message “The volume is: “.

10

10

3. When the “Exit” button is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

C When view result button is clicked the result should be displayed in a

proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 5: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

5. Write a JAVA program which performs the following listed operations: A. Create a package named MyShapePackage which consists of

following classes

1. An abstract class named Shape which stores information of final variable PHI. The class should also contain abstract method like Area.

05

2. A class named Rectangle which inherits Shape class. Also add information like length and breadth. The class should also contain parameterized constructor named Rectangle (length, Breadth). Also implement method Area() and define it in the class.

10

3. A class named Circle which inherits Shape class. Also add information like radius. The class should also contain parameterized constructor named Circle (radius). Also implement method Area() and define it in the class.

4. A class named AddShapeFrame which displays a frame consisting

of appropriate controls to enter the details of a length, breadth and radius and store these details in the Rectangle/ Circle class object. The frame should also have four buttons with the caption as “Calculate Rectangle Area” and “Calculate Circle Area” and “Exit” and ”View Result”.

5. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

05

05

B 1. When the “Calculate Circle Area” button is clicked, then the Area of

the Circle should be calculated and stored in the file and a dialog box should be appeared with the calculated circle area and with the message “The area of circle is: “.

2. When the “Calculate Rectangle Area” button is clicked, then the Area of the Rectangle should be calculated and stored in the file and a dialog box should be appeared with the calculated Rectangle area and with the message “The Area of Rectangle is: “.

10

10

3. When the “Exit” button is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

C When view result button is clicked the result should be displayed in a

proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions where ever required in all the classes

10

Page 6: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

6. Write a JAVA program which performs the following listed operations: A. Create a package named MyInterestPackage which consists of

following classes

1. An abstract class named Deposit which stores information of principal, year and year. The class should also contain abstract method like Interest (principal, rate, year).

05

2. A class named Simple_Interest which inherits Deposit class. The class should also contain parameterized constructor named Simple_Interest (principal, rate, year). Also implement method Interest (principal, rate, year) to calculate the simple Interest and define it in the class.

10

3. A class named Compound_Interest which inherits Deposit class. The class should also contain parameterized constructor named Compound_Interest (principal, rate, year). Also implement method Interest (principal, rate, year) to calculate the Compound_Interest and define it in the class.

4. A class named AddInterestFrame which displays a frame consisting of appropriate controls to enter the details of a principal, rate and year and store these details in the Simple_Interest/Compound_Interest class object. The frame should also have four buttons with the caption as “Calculate Simple Interest” and “Calculate Compound Interest” and “Exit” and ”View Result”.

5. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

05

05

B 1. When the “Calculate Simple Interest” button is clicked, then the

Simple Interest should be calculated and stored in the file and a dialog box should be appeared with the calculated simple Interest and with the message “The Simple Interest is:”.

2. When the “Calculate Compound Interest” button is clicked, then the Compound Interest should be calculated and stored in the file and a dialog box should be appeared with the calculated Compound Interest and with the message “The Compound Interest is:”.

10

10

3. When the “Exit” button is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

C When view result button is clicked the result should be displayed in a

proper format on the same frame in a text area. [The records should be

fetched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 7: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

7. Write a JAVA program which performs the following listed operations: A. Create a package named MyExamPackage which consists of

following classes

1. An interface named Exam with a method passExam(obtained marks, total marks) that returns Boolean.

05

2. An interface named Classify with a method findDivision (percentage) that returns division of the student as String.

05

3. A class named Exam_result that implements both Exam and

Classify. Define the passExam() and findDivision() in this class. The passExam() should return true if the marks obtained is equal or greater than 35%. The findDivision() should return “FIRST” if marks obtained are greater than or equal to 60%, “SECOND” if marks obtained are less than 60 % and greater than or equal to 50% else “NO DIVISION”.

4. A class named AddExamFrame which displays a frame consisting of appropriate controls to enter the details of a name, marks and

total marks and store these details in the Exam_Result class object. The frame should also have four buttons with the caption as “Add Marks” and “Find Division” and “Exit” and ”View Result”.

5. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

10

05

B 1. When the “Add Marks” button is clicked, then the marks should be

stored in the file and a dialog box should be appeared with the message “Record Inserted Successfully”.

2. When the “Find Division” button is clicked, then the Division should be calculated and stored in the file and a dialog box should be appeared with the division with the message “Your division is: “.

10

10

3. When the “Exit” button is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

C When view result button is clicked the result should be displayed in a

proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions where ever required in all the classes

10

Page 8: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

8. Write a JAVA program which performs the following listed operations: A. 1. Create a class named Login which takes

information like username and password. Also create proper get

and set methods for data. 2. Create a class named LoginFrame which

displays a frame consisting of appropriate controls to enter user name and password and a button submit. When the button submit is clicked the user name and password is entered by the

user is stored in the Login Object and compared with the user name and password stored in the file. If the comparison is

successful than a new frame named Registration should be displayed.

05

10

B 1. Create a new class named Registration which takes information

of student like first name, middle name, last name and address.

Also create proper get and set methods for data.

10

2. A class named AddRegistrationFrame which displays a frame consisting of appropriate controls to enter the details of a student and store these details in the Registration class object. The frame should also have two buttons with the caption as “Add Record”, “View Record”.

3. Also implement thread in the AddRegistrationFrame which displays current system time in the bottom side of the frame.

4. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

10

05

C 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

2. When view result button is clicked the result should be displayed in a proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

10

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D Provide proper error messages and perform appropriate exceptions where

ever required in all the classes 10

Page 9: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

9. Write a JAVA program which performs the following listed operations: A. 1. Create a class named Login which takes information like

username and password. Also create proper get and set methods

for data. 2. Create a class named LoginFrame which displays a frame

consisting of appropriate controls to enter user name and password and a button submit. When the button submit is clicked the user name and password is entered by the user is

stored in the Login Object and compared with the user name and password stored in the file. If the comparison is successful

than a new frame named Registration should be displayed.

05

10

B 1. Create a new class named Book_Registration which takes

information of Book like Book name, price, Authors, No of copies. Also create proper get and set methods for data.

10

2. A class named AddRegistrationFrame which displays a frame consisting of appropriate controls to enter the details of a student and store these details in the Registration class object. The frame should also have two buttons with the caption as “Add Record”, “View Record”.

3. Also implement thread in the AddRegistrationFrame which displays current system time in the bottom side of the frame.

4. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

10

05

C 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

2. When view result button is clicked the result should be displayed in a proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

10

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D Provide proper error messages and perform appropriate exceptions where

ever required in all the classes 10

Page 10: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

10. Write a JAVA program which performs the following listed operations: A. Create a package named MyPayPackage which consists of following

classes

1. An interface named Calculate with a method calculate_totalpay(basic pay) .

05

2. A class named Employee_pay that implements Calculate. Also take information like employee first name, last name.

Define the calculate_totalpay(basic pay) in this class. Also calculate DA, HRA in the method calculate_totalpay() DA= 10% of Basic Pay HRA=45% of Basic Pay Total Pay= DA+HRA+Basic Pay.

3. A class named AddPayFrame which displays a frame consisting of appropriate controls to enter the details of a Basic Pay and store these details in the Employee_pay class object. The frame should also have three buttons with the caption as “Calculate Total Pay” and “Exit” and ”View Result”.

4. Also implement thread in the AddPayFrame which displays current system time in the bottom side of the frame.

5. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

10

10

10 10

B 1. When the “Calculate Total Pay” button is clicked, then the total pay

should be calculated and all the details like Name, HRA, DA, Total pay should be stored in the file and a dialog box should be appeared with the message “Record Inserted Successfully”.

10

2. When the “Exit” button is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

C When view result button is clicked the result should be displayed in a

proper format on the same frame in a text area. [The records should be fetched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 11: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

11. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Item which stores information like the Item no, Item name, Price of the Item. The class should also contain appropriate get and set methods.

05

2. A class named AddItemFrame which displays a frame consisting of appropriate controls to enter the details of a Item and store these details in the Item class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame

controls to a pre – defined file.

10

C Provide a menu on the AddItemFrame which has menu items titled,

“Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D 1. The “Search record” button should open a new frame which should

take input of search criteria using a radio button. The radio button should provide facility to search on basis of item name.

10

2. The new frame should also have a text box to input the search criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 12: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

12. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Course which stores information like the Course no, Course name, Max_Marks, Pass_Marks. The class should also contain appropriate get and set methods.

05

2. A class named AddCourseFrame which displays a frame consisting of appropriate controls to enter the details of a Course and store these details in the Course class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame

controls to a pre – defined file.

10

C Provide a menu on the AddCourseFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D 1. The “Search record” button should open a new frame which should

take input of search criteria using a radio button. The radio button should provide facility to search on basis of course name.

10

2. The new frame should also have a text box to input the search criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 13: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

13. Write a JAVA program which performs the following listed operations: A. Create a package named MyHostelPackage which consists of

following classes

1. A class named Hostel which stores information like the Hostel number, hostel name, address and total capacity. The class should also contain appropriate get and set methods.

05

2. A class named AddHostelFrame which displays a frame consisting of appropriate controls to enter the details of a Hostel and store these details in the Hostel class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Delete Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of Hostel Name.

10

2. The new frame should also have a text box to input the delete criteria value.

10

3. The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully deleted”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 14: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

14. Write a JAVA program which performs the following listed operations: A. Create a package named MyHotelPackage which consists of

following classes

1. A class named Hotel which stores information like the Hotel number, hotel name, address, no of rooms and total capacity. The class should also contain appropriate get and set methods.

05

2. A class named AddHotelFrame which displays a frame consisting of appropriate controls to enter the details of a Hotel and store these details in the Hotel class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Delete Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of Hotel Name.

10

2. The new frame should also have a text box to input the delete criteria value.

10

3. The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully deleted”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 15: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

15. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Movie which stores information like the Movie Id, Movie name, Date of Release. The class should also contain appropriate get and set methods.

05

2. A class named AddMovieFrame which displays a frame consisting of appropriate controls to enter the details of a Movie and store these details in the Movie class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame

controls to a pre – defined file.

10

C Provide a menu on the AddMovieFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D 1. The “Search record” button should open a new frame which should

take input of search criteria using a radio button. The radio button should provide facility to search on basis of Movie name.

10

2. The new frame should also have a text box to input the search criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 16: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

16. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Distributor which stores information like the Distributor Id, Distributor name, address, Contact No. The class should also contain appropriate get and set methods.

05

2. A class named AddDistributorFrame which displays a frame consisting of appropriate controls to enter the details of a Distributor and store these details in the Distributor class object. The frame should also have two buttons with the caption as “Add Record” and “Update Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame controls to a pre – defined file.

10

C Provide a menu on the AddDistributorFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

D 1. The “Update record” button should open a new frame which should

take input of update criteria using a radio button. The radio button should provide facility to update on basis of Distributor name.

10

2. The new frame should also have a text box to input the update criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the

appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 17: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

17. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Worker which stores information like the Worker Id, Worker name, address, Contact No, wage per hour. The class should also contain appropriate get and set methods.

05

2. A class named AddWorkerFrame which displays a frame consisting of appropriate controls to enter the details of a Worker and store these details in the Worker class object. The frame should also have two buttons with the caption as “Add Record” and “Update Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame

controls to a pre – defined file.

10

C Provide a menu on the AddWorkerFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D 1. The “Update record” button should open a new frame which should

take input of update criteria using a radio button. The radio button should provide facility to update on basis of Worker name.

10

2. The new frame should also have a text box to input the update criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 18: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

18. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Publisher which stores information like the Publisher Id, Publisher name, address, Contact No. The class should also contain appropriate get and set methods.

05

2. A class named AddPublisherFrame which displays a frame consisting of appropriate controls to enter the details of a Publisher and store these details in the Publisher class object. The frame should also have two buttons with the caption as “Add Record” and “Update Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame controls to a pre – defined file.

10

C Provide a menu on the AddPublisherFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

D 1. The “Update record” button should open a new frame which should

take input of update criteria using a radio button. The radio button should provide facility to update on basis of Publisher name.

10

2. The new frame should also have a text box to input the update criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the

appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 19: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

19. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Entrance_Test which stores information like the Test Id, Test name, Max_Marks, Pass_Marks. The class should also contain appropriate get and set methods.

05

2. A class named AddTestFrame which displays a frame consisting of appropriate controls to enter the details of a Entrance_Test and store these details in the Entrance_Test class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Delete Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of Test Name.

10

2. The new frame should also have a text box to input the delete criteria value.

10

3. The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully deleted”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 20: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

20. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Competition which stores information like the Competition Id, Competition name, No of Participants. The class should also contain appropriate get and set methods.

05

2. A class named AddCompetitionFrame which displays a frame consisting of appropriate controls to enter the details of a Competition and store these details in the Competition class object. The frame should also have three buttons with the caption as “Add Record” and “Update Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Update Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to update on basis of Competition Name.

10

2. The new frame should also have a text box to input the update criteria value.

10

3. The record should be updated from the file and a message dialog should appear with the message that “Record is successfully updated”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 21: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

21. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Magazine which stores information like Magazine Id, Magazine Name and Type of Subscription. The class should also contain appropriate get and set methods.

05

2. A class named AddMagazineFrame which displays a frame consisting of appropriate controls to enter the details of a Magazine and store these details in the Magazine class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame controls to a pre – defined file.

10

C Provide a menu on the AddMagazineFrame which has menu items

titled, “Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the appropriate events]

D 1. The “Search record” button should open a new frame which should

take input of search criteria using a radio button. The radio button should provide facility to search on basis of Magazine name.

10

2. The new frame should also have a text box to input the search criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the

appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 22: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

22. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Account which stores information like the Account No, Account Name, Account type. The class should also contain appropriate get and set methods.

05

2. A class named AddAccountFrame which displays a frame consisting of appropriate controls to enter the details of a Account and store these details in the Account class object. The frame should also have three buttons with the caption as “Add Record” and “Update Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Update Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to update on basis of Account Name.

10

2. The new frame should also have a text box to input the update criteria value.

10

3. The record should be updated from the file and a message dialog should appear with the message that “Record is successfully updated”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 23: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

23. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Parts which stores information like Part Id, Part Name, Part Color, Price. The class should also contain appropriate get and set methods.

05

2. A class named AddPartFrame which displays a frame consisting of appropriate controls to enter the details of a part and store these details in the part class object. The frame should also have two buttons with the caption as “Add Record” and “Search Record”.

05

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B The “Add record” button should add the record entered in the frame

controls to a pre – defined file.

10

C Provide a menu on the AddPartFrame which has menu items titled,

“Set the record file” and “Exit”. 05

1. When the “Set the record file” menu item is clicked, the user should be asked to input the complete path of the file where he desires to save the records.

05

2. When the “Exit” menu item is clicked, the frame should be closed. 05

[Note: Use the MyCustomListener class only to handle the

appropriate events]

D 1. The “Search record” button should open a new frame which should

take input of search criteria using a radio button. The radio button should provide facility to search on basis of Part Name.

10

2. The new frame should also have a text box to input the search criteria value.

10

3. The search result should be displayed in a proper format on the same frame in a text area. [The records should be searched from the pre – defined file which consists all saved records]

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

E Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 24: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

24. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Department which stores information like Dep_Id, Dep_name, No of Employees. The class should also contain appropriate get and set methods.

05

2. A class named AddDeptFrame which displays a frame consisting of appropriate controls to enter the details of a Department and store these details in the Department class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Delete Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of Department Name.

10

2. The new frame should also have a text box to input the delete criteria value.

10

3. The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully deleted”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10

Page 25: Gujarat Technological University...Gujarat Technological University Master of Computer Applications ... C When view result button is clicked the result should be displayed in a proper

25. Write a JAVA program which performs the following listed operations: A. Create a package named MyPackage which consists of following

classes

1. A class named Boat which stores information like Boat Id, Boat Name, Boat Color, Price. The class should also contain appropriate get and set methods.

05

2. A class named AddBoatFrame which displays a frame consisting of appropriate controls to enter the details of a Boat and store these details in the Boat class object. The frame should also have three buttons with the caption as “Add Record” and “Delete Record” and “Exit”.

10

3. A class named MyCustomListener which should work as a user – defined event listener to handle required events as mentioned in following points.

05

B 1. When the “Add Record” button is clicked, the dialog box should be

appeared with asking the user “Do you really want to add record in the file”. If the user selects Yes than the record should be saved in the file.

10

2. When the “Exit” button is clicked, the frame should be closed. 10

[Note: Use the MyCustomListener class only to handle the appropriate events]

C 1. The “Delete Record” button should open a new frame which should

take input of delete criteria using a radio button. The radio button should provide facility to delete on basis of Boat Name.

10

2. The new frame should also have a text box to input the delete criteria value.

10

3. The record should be deleted from the file and a message dialog should appear with the message that “Record is successfully deleted”.

10

[Note: Use the MyCustomListener class only to handle the appropriate events]

D Provide proper error messages and perform appropriate exceptions

where ever required in all the classes

10