Googlee InfoEdge Skip to main content

Posts

Showing posts from September, 2021

TCS Xplore IRA 6thSep2021 Python and Java SBQ

Create a class Leave with the below attributes:   leaveId of type int leaveType of type String having values as EL/CL/SL noOfDays type int dateOfApplication of type String in the format dd-mm-yy (12-07-21)   Note: leaveType EL represents Earned Leave, CL is Casual Leave and SL is Sick Leave. Assume that Leave details are only for the year 2021.     Create the init method which takes the parameters in the above sequence. The method should set the value of attributes to parameter values.     Create another class Employee with the below two attributes: 1. leaveList of type List having Leave objects 2. leaveBalance of type Dictionary having leaveType as Key and remaining leaves of that type as Value. Eg. {EL:20,CL:2,SL:31}   Create the init method which takes all parameters in the above sequence. The method should set the value of attributes to parameter values inside the method. Create below two methods inside the Employee class:   1. getUpdatedLeaveBalance - This method checks for t