Answered step by step
Verified Expert Solution
Link Copied!

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

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Programming questions

Question

What is memory ?

Answered: 1 week ago