name:String, age:int)
toString():String - return a string that contains all the information of the Professor: name, age, numOfChild and tenure
+ getGrossIncome():double + getTax(salary:double):double +toString():String
.
tenure
getGrossIncome():double - return gross income with gross income is calculated according to tenure as below:
Gross Income
>=1 and <= 3
3000
>3
5000
getTax(salary:double): double return tax of a professor with below rules:
o deduction = numOfChild*900
o taxable income salary - deduction
o If taxable income < 0 then tax is 0
o Depends on taxable income, we will calculate tax as
taxable income
tax
0.1*taxable income
follows:
<=1000
>1000
0.2*taxable income
The program outputs might look something like:
1.Test toString()
2.Test getGrossIncome()
1.Test toString()
2. Test getGrossincome()
1.Test toString()
2.Test getGrossIncome()
Zoom
+ 90%
Close