Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

- age - integer number - name - String - DSI - String - Salary - floating point

ID: 3660887 • Letter: #

Question

- age - integer number - name - String - DSI - String - Salary - floating point number public static void main(String args[]) { //s1 will take all default value StudentEmployee s1 = StudentEmployee(); //s2 will take all supplied value StudentEmployee s2 = StudentEmployee(50, "Jackie Chan", "D87654321", 10000000.99); //s3 will take supplied age value. name, DSI and salary will take default values StudentEmployee s3 = StudentEmployee(25); //s4 will take supplied age and name value. DSI and salary will take default value StudentEmployee s4 = StudentEmployee(35, "Jenny"); //s5 will take supplied age, name and DSI value. salary will take default value StudentEmployee s5 = StudentEmployee(45, "Jack", "D11223344"); //s6 will take supplied age, name and salary value. DSI will take default value StudentEmployee s6 = StudentEmployee(60, "James Bond", 65000.0); //s7 will take the same value of s2 StudentEmployee s7=s2; //the rest of the code }

Explanation / Answer

Note: I have just added the overloaded constructors, it can be compiled and run, but it doesn't display anything as we don't have any out statements. public class StudentEmployee { int age; String name; String DSI; double Salary; StudentEmployee() { this(0,"","",0.0);    } StudentEmployee(int nage, String strName, String strDSI, double sa) { name =strName; age = nage; DSI=strDSI; Salary = sa;    } StudentEmployee(int nage) { this(nage,"","",0.0); } StudentEmployee(int nage,String strName) { this(nage,strName,"",0.0); } StudentEmployee(int nage,String strName, String strDSI) { this(nage,strName,strDSI,0.0); } StudentEmployee(int nage,String strName, double sa) { this(nage,strName,"",sa); } StudentEmployee(StudentEmployee newemp) { this(newemp.age, newemp.name, newemp.DSI, newemp.Salary); } public static void main(String args[]) { //s1 will take all default value StudentEmployee s1 =new StudentEmployee(); //s2 will take all supplied value StudentEmployee s2 =new StudentEmployee(50, "Jackie Chan", "D87654321", 10000000.99); //s3 will take supplied age value. name, DSI and salary will take default values StudentEmployee s3 =new StudentEmployee(25); //s4 will take supplied age and name value. DSI and salary will take default value StudentEmployee s4 =new StudentEmployee(35, "Jenny"); //s5 will take supplied age, name and DSI value. salary will take default value StudentEmployee s5 =new StudentEmployee(45, "Jack", "D11223344"); //s6 will take supplied age, name and salary value. DSI will take default value StudentEmployee s6 =new StudentEmployee(60, "James Bond", 65000.0); //s7 will take the same value of s2 StudentEmployee s7=s2; //the rest of the code } }