Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 (25 marks) Given the following superclass named Tax and subdass named Income Tax Superdass Tax Attributes private String payer Name // Tax payer

image text in transcribed

Question 2 (25 marks) Given the following superclass named Tax and subdass named Income Tax Superdass Tax Attributes private String payer Name // Tax payer name private String paveric // Tax payers C private boolean citizen Citizen or non-citizen Methods Normal constructor accessor, printer Subclass Attributes Income Tax private double grossSalary private double expenses Normal constructor accessor printer Methods ii th a) Based on the above information, answer the following questions. 1 Explain the reason why Tax is superclass and Income Tax is subclass. (2 marks) Identify additional data member for subclass (1 mark) Suggest another two (2) kind of taxes (2 marks) b) Write a complete class definition for Income Tax that includes the following behaviors. normal constructor accessor methods an overriding printer method that displays information of income tax payers A processor method named coleIncome Tax () that calculates and returns the Income tax charge. The income tax charge depends on the net salary. The table below shows the rate for the income tax charge . Net Salary (RM) Below 5,000.00 5,000.00 - 20.000.00 20,000.00 35,000 00 More than 35,000.00 Rate 0% 3% 8% 10% Net salary Gross salary - expenses **Non-citizen will be charged an additional 3.5% of the total income tax charge (10 marks) c) Write a Java nain) program to perform the following tasks Declare an array of Income Tax objects of size 100 Input all tax payer's information and store into the array Display the total charge for non-citizen tax payers whose gross salary greater than 35,000.00 Display all information of taxpayers from Melaka Example tax payer's IC - 850413040307 Code 04 represents Melaka . (10 marks)

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

Elasticity and Pricing

Answered: 1 week ago

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago