Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer quickly. jaba 2 Consider the following interface and three classes. > Bonus +RATE: double + calculateBonus () : doubie Employee -name:String -adress: String +Employee

answer quickly. jaba 2 image text in transcribed
image text in transcribed
Consider the following interface and three classes. > Bonus +RATE: double + calculateBonus () : doubie Employee -name:String -adress: String +Employee in: String, a: String) +toString(): String +get Salary(): double Salesman -sales : intl +Salesman (n: String, at String get Salary(): double setsale (month:int, sale:double):void toString(): String -salary double +IT( n:String, a:String. s: double) +get Salary(): double toString(): String A. Create the abstract class Employee 16 pts/ a) Define the Constructor (with arguments) 12 pts] b) Define the Lostring() method Example Rami@ Koura (2 pts c) Detine the abstract method get Salary() 12 pts B. Create the interface Bonus 14 pts C. Define the the class Salesman that manipulates a set of operations on the annual sales. The array sales of size 12 is used to store the sales for 12 months. [24 pts a) Write the constructor (with arguments except for the sales which should be initialized to 0.14 pts N. 12 pts nethod. Example: Rami@ Koura (2 pts) bstract method getSalary (12 pts B. Create the interface Bonus 14 pts C. Define the the class Salesman that manipulates a set of operations on the annual sales. The array sales of size 12 is used to store the sales for 12 months 124 pts/ a) Write the constructor (with arguments except for the sales which should be initialized to 01.14 pts] b) Write the method set Sale (int month, double sale) which set the sale for a given month You should test if the month is valid (between 1 and 12). 15 pts c) Implement the method get Salary() to calculate the average salary per year, i.c. the total of sales for all months divided by 12. 15 pts] d) Implement the method calculateBonus ) of the Bonus interface hat calculate the bonus per year. The bonus is computed as the product of the the total sales of all the year and the RATE, 15 pts] e) Override the toString() method to return a string of the below form Example: Rami@Koura, Annual sales = {(1.1200,00).(2.1755.50).... (12, 1550.00)> 15 pts! Page 2 of 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

4. What action should Cherita Howard take and why?

Answered: 1 week ago