Sunday, 13 December 2015

Java Lab@home 9

1.1. 2. 3. • • • • • David has been assigned a task of creating an application to store the employee details. For this, David decides to display the following menu when the application starts: Enter Data Display Data Exit Thereafter, he decides to implement the following functionalities: When a user selects the option to enter data, the employee details, such as employee ID, employee name, department, designation, date of joining, date of birth, marital status, and date of marriage, should be captured. However, the date of marriage can be captured only if the employee is married. In addition, a functionality to add more records should be implemented. When a user selects the option to display the data, the stored data must be displayed. When a user selects the option to exit, the application must be terminated. Further, David needs to implement user-defined exceptions for the following cases: If the menu input entered by the user is other than 1, 2, or 3, an appropriate message should be displayed to the user and the application must restart. If the employee ID does not start with the alphabet, e or E, an appropriate message should be displayed to the user and the application must terminate. Help David to implement the preceding functionalities.

Ans    CLICK HERE


2.Create a new project and catch checked and unchecked exceptions.


Ans    CLICK HERE


3.Take an existing application and refactor the code to make use of a custom exception class and a custom auto-closeable resource.


Ans.     CLICK HERE


4. Create a calculator application in Java that will accept two numbers. In addition, the calculator application should allow a user to perform any of the following operations at a time on the two given numbers: Addition Subtraction Multiplication Division Further, you need to implement assertions to assert that both the numbers should be greater than 0.


Ans     CLICK HERE


5.You need to write a program to register the member details to get an entry ticket of a disco. The program should accept the member details, such as name, contact number, and age. In addition, the program must throw an exception with an appropriate message if the age is not within the range of 18 to 55.


Ans  CLICK HERE

10 comments: