Question: Exercise 1 (10 marks) (Exl.java) A. Complete the class Myclass. public class MxClass { private int x; private static int count: MyClass { l/initialize x



Exercise 1 (10 marks) (Exl.java) A. Complete the class Myclass. public class MxClass { private int x; private static int count: MyClass { l/initialize x to 0 } MxClass(int a) { // initalize x to a } SeX( int a) { } printXO { } ...public static printCounto { } incrementCounto { }} a. Write the main program to test this class b. Declare myObject1 to be a MxClass object and initialize its instance variable x to 0. C. Declare myObject2 to be a MxClass Object and initialize its instance variable x to 7. B. Use java comments to write the answers of the following questions: a. Which of the following statement are valid? i myObject1.printCount(); ii. myObject1.printX(); 111. My Class.printCounto: iv. MxClass.printxo: V. MxClass.count++; b. What the output of the following? i. myObject1.printX0; ii. myObject1.incrementCount(); myObject1.printCount(); myObject2.printCount(): 111. MxClass.incrementCountO; myObject1.printCount(); myObject2.printCount(): iv. myObject2.incrementCount(); myObject1.printCount():myObject2.printCounto: V. myObject1.setX(19); myObject1.printX0;myObject2.printxo: Exercise 2 (10 marks) In reference to the payroll system problem in labs# 2 and 4. Students have to work on the same payroll project and do the following: 1. Insert Jtable into the Jfram form. When the user clicks on the calculate button the system shall do all of the calculations mentioned in lab#2 then it shall view in the Itable the employee name , position, total deductions and net pay). 2. Insert delete button that shall erase the selected row from the Jtable. Employee Payroll System Name Hassan Jameel Name Hassan Jameel Position WORKER P2 Hours/W 60 Position ADMIN Hours/W 20 Rate/h Overtime Medical Insurance Dental Insurance Disability Insurance Retirement Plan Regular Wage Overtime Wage Total Wage M Medical Insurance Dental Insurance Disability Insurance Total Deductions Retirement Plan Net Pay 1020 Employee Name Mohammad Banat Faten Hassan Jameel Delete Position ADMIN WORKER P1 WORKER P2 Total Deductions 130 50 10 Net Pay 920 800 1020 Cakulte Reset Exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
