Design a Java program to calculate the tax an employee has to pay based on their...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design a Java program to calculate the tax an employee has to pay based on their salary. The tax rules are as follows: If the salary is R10 000 and below, the tax is 0%. If the salary is more than R10 000 but less than or equal to R20 000, the tax is 10%. If the salary is more than R20 000 but less than R40 000, the tax is 20%. If the salary is more than R40 000, the tax is 25%. Make a class called Employee with three instance variables: name, number, and salary. The class should have a constructor that sets the values of the instance variables. Implement three methods: A method that calculates the tax amount based on the salary. A method that returns the tax percentage as a decimal. A method that displays the employee information including the tax amount and tax percentage. Note: You are not allowed to use a switch statement or if-else chains. Instead, you should use a different control structure to implement the tax calculation. Output - AssQuestionOne (run) x DD Name Employee No 1010 Java BUILD SUCCESSFUL (total time: 2 seconds) Salary R700000.0 After Tax R525000.0 Figure 1.1: Output of the Employee Tax calculation Program. Tax value 25.0% Design a Java program to calculate the tax an employee has to pay based on their salary. The tax rules are as follows: If the salary is R10 000 and below, the tax is 0%. If the salary is more than R10 000 but less than or equal to R20 000, the tax is 10%. If the salary is more than R20 000 but less than R40 000, the tax is 20%. If the salary is more than R40 000, the tax is 25%. Make a class called Employee with three instance variables: name, number, and salary. The class should have a constructor that sets the values of the instance variables. Implement three methods: A method that calculates the tax amount based on the salary. A method that returns the tax percentage as a decimal. A method that displays the employee information including the tax amount and tax percentage. Note: You are not allowed to use a switch statement or if-else chains. Instead, you should use a different control structure to implement the tax calculation. Output - AssQuestionOne (run) x DD Name Employee No 1010 Java BUILD SUCCESSFUL (total time: 2 seconds) Salary R700000.0 After Tax R525000.0 Figure 1.1: Output of the Employee Tax calculation Program. Tax value 25.0%
Expert Answer:
Answer rating: 100% (QA)
To design a Java program that calculates the tax an employee has to pay based on their salary follow ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Without using row reduction, apply block operation on A to compute its inverse. [1 2000 3 50 00 A=0 0 2 00 0007 8 0 0056
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Briefly explain the meaning of the following concepts and terms: greenhouse gases (GHGs), the IPCC, the little ice age, the Keeling graph, telekinetic property of the atmosphere, global weirding,...
-
A hand truck is used to move two barrels, each weighing 80 lb. Neglecting the weight of the hand truck, determine (a) The vertical force P which should be applied to the handle to maintain...
-
Discuss each of the theoretical change models introduced in this chapter. How can we use them when planning an HRIS implementation to increase our chances of success?
-
Use the Flowell Design Ltd. data from Problem 17-3B. In Problem 17-3B Required 1. Prepare the 2017 cash flow statement by the indirect method. If your instructor also assigned Problem 17-3B, prepare...
-
The Statement of Cash Flows for the current year contained the following: Cash received from customers Cash used for purchase of equipment Cash received for stock issuance Cash used for payments to...
-
On November 1, 2005, Janet Morton and Kim Wong formed Pet Kingdom, Inc., to sell pets and pet supplies. Pertinent information regarding Pet Kingdom is summarized as follows: Pet Kingdom's business...
-
Use an aggregate demand and supply model to demonstrate where the Australian economy is currently operating in relation to full employment and explain the reasons for this.
-
Describe the sources of economic growth and identify the source of the growth slowdown.
-
What are the two distinguishing characteristics of oligopoly?
-
Describe the trends and fluctuations in the U.S. employment-to-population ratio and the labor force participation rate from 1981 to 2021.
-
What are the distinctions between domestic and national, and gross and net?
-
What are the two types of unemployment described in the news clip? Why is one of them more worrying for officials in Singapore? Singapore has been facing increasing unemployment due to a slowdown in...
-
8. What is the proper preparation sequencing of the following budgets? 1. Budgeted Balance Sheet 2. Sales Budget 3. Selling and Administrative Budget 4. Budgeted Income Statement a. 1, 2, 3, 4 b. 2,...
-
Use nodal analysis to determine voltages v1, v2, and v3 in the circuit Fig. 3.76. Figure 3.76 4 S 3i, 2 A 4A
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Your supervisor has asked you to research the following situation concerning Owen and Lisa Cordoncillo. Owen and Lisa are brother and sister. In May 2012, Owen and Lisa exchange business pickup...
-
Professor Patricia (Patty) Pate is retired from the PalmSprings Culinary Arts Academy (PSCAA). She is a single taxpayer and is 68 years old. Patty lives at 98 Colander Street, Henderson, NV 89052....
-
A small stone is fastened to the top of a standard cart of inertia \(1 \mathrm{~kg}\) to form a combination of unknown inertia \(m_{1}\). A second standard cart is then launched with an initial...
-
(a) A red cart with an initial speed of \(0.35 \mathrm{~m} / \mathrm{s}\) collides with a stationary standard cart \(\left(m_{\mathrm{s}}=1.0 \mathrm{~kg} ight)\). After the collision, the standard...
-
A person standing on a skateboard on horizontal ground pulls on a rope fastened to a cart. Both the person and the cart are initially at rest. Use the Procedure box to identify an isolated system and...
Study smarter with the SolutionInn App