Oop Activity Saad 21414
Oop Activity Saad 21414
NAME:
SAAD CHEEMA
NUML ID:
NUML-F24-21414
CLASS:
BSIT-2 MORNING
COURSE:
OBJECT ORIENTED PROGRAMMING
(THEROY)
SUBMITTED TO:
MS. SOBIA YOUSAF
class Employee {
String name;
int age;
double salary;
2. Class Manager:
- Inherits from the Employee class and adds a new attribute department.
- The inputData() method calls the super.inputData() method to get the
employee’s data and then asks for the manager's department.
- The printData() method calls super.printData() to print employee data and adds
the manager’s department.
3. Class Project:
- Inherits from Manager and adds attributes for the project: projectName and
projectBudget.
- The inputData() method calls super.inputData() to get the data from both the
employee and manager classes, then asks for the project-specific data.
The printData() method calls super.printData() to print all the inherited data and
adds the project-specific data.
4. Main Class (Main):
- In the main() method, an object project of the Project class is created.
- The inputData() method is called to take input for all the attributes.
- The printData() method is then called to display the input data.
Example Output:
Enter Employee Name: John
Enter Employee Age: 35
Enter Employee Salary: 50000
Enter Manager Department: IT
Enter Project Name: Web Development
Enter Project Budget: 200000