Question: Read the following scenario, and help the programmers to develop a code without any errors and display appropriate warning messages: Scenario: Code running on the

Read the following scenario, and help the programmers to develop a code without any errors and display appropriate warning messages:

Scenario:

Code running on the real time live application, without proper exception handling is nightmare for developers. It might be any type of application from simple to complex. When exception handling is in place you can easily point out the pain area of application and resolve the issue.

ABC Company deals with employee wages and calculates the total salary for employees. Sometimes, knowing or unknowingly, data entry mistake has been made by the data entry operator. As a Java developer you are asked to fix the bug and display the proper warning message to the data entry operator if he/she makes mistakes in entering.

Declare a class Weekly_Wages with the following properties.

Employee_Id stores employee id in number format - integer Employee_Name stores employee name in text format - string Days Number of days employee actually in a week - integer Weekly_Wages [] An double array for maximum 7 inputs as wages Total Find the total wages - Double

Formula:

Total_wages = (Summation of weekly wages)

Expected Output:

Employee Id :

Employee Name: Total Wages: ________

Possible Wrong Data entry cases, catch the respective errors and display proper warning message. Case 1:Employee_Id should be a number whereas dataentry made as E2016727 which caused the error

Case 2: Maximum number of days (Days) is Seven in a week, whereas user entered number of days more than 7 which caused an error

Rubric

a) Design the Weekly_Wages class

b) Display the expected output for the proper data entry

c) Case 1: Design the Code statement to fix error and display the warning message

d) Case 2: Design Code statement to fix error and display the warning message

e) Integrate the whole program and overall program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!