Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the UML diagram below, the classes Programmer and the Accountant both extend the Employee class, and they inherit the fields name, age, and
In the UML diagram below, the classes Programmer and the Accountant both extend the Employee class, and they inherit the fields name, age, and salary from employee. Create the three classes then test them by create: 1. Accountant: name: Ahmed, age: 30, salary: 15000, role: Account Receivable 2. Programmer: name: Maryam, age: 26, salary: 14000, languages: C++, Python, Java 3. Print the details of each object and print the number of Employees. -name: String -age: int - salary: double -numOfEmployees: static int + Employee() Employee(String, int, double) setName(String) void setAge(int): void setSalary(double): void Employee getName(): String getAge(): int getSalary(): double getNumOfEmployees(): static int toString(): String Extends Programmer -languages: ArrayList + Programmer() + Programmer(String, int, double) + addLanguage(String); void + toString(): String Extends Accountant -role: String + Accountant()) +Accountant(String, int, double, String) setRole(String): void -getRole(): String +toString(): String
Step by Step Solution
There are 3 Steps involved in it
Step: 1
three Java classes Employee Programmer and Accountant The Employee class will be the base class and the Programmer and Accountant classes will extend it The Employee class should have the following fi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started