Expand the cryptic code in the getFICA method of the Employee3 class in Figure 14.20 into if
Question:
Expand the cryptic code in the getFICA method of the Employee3 class in Figure 14.20 into “if else” statements so that the algorithm is easier to understand.
Figure 14.20
Transcribed Image Text:
/**************** *Employee3.java * Dean & Dean * * This abstract class describes employees, and it includes * Social Security tax calculation. ***************************************************************/ public abstract class Employee3 implements Commission2 { public abstract double getPay(); private String name; private final static double FICA_TAX_RATE= 0.08; // fraction private final static double FICA_MAX = 90000; // dollars private double ytdIncome; // total year-to-date income //**************** public Employee 3 (String name) { } ***************************************** this.name = name; //* public void printPay (int date) ( } // end printPay //**** { System.out.printf("%2d %10s: %8.2f ", date, name, getPay()); ***** ******************** *******: // Postcondition: ytdIncome is increased by pay. protected double getFICA(double pay) double increment, tax; ytdIncome + pay; increment FICA_MAX- ytdIncome; } // end getFICA 3 // end class Employee3 ************** **************** This limits accessibility to classes In the subtree or in the same package. tax = FICA_TAX_RATE * (pay increment? pay: (increment > 0 ? increment : 0)); return tax;
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
The getFICA method in the Employee3 class is designed to calculate the FICA Federal Insurance Contri...View the full answer
Answered By
Muhammad Umair
I have done job as Embedded System Engineer for just four months but after it i have decided to open my own lab and to work on projects that i can launch my own product in market. I work on different softwares like Proteus, Mikroc to program Embedded Systems. My basic work is on Embedded Systems. I have skills in Autocad, Proteus, C++, C programming and i love to share these skills to other to enhance my knowledge too.
3.50+
1+ Reviews
10+ Question Solved
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Question Posted:
Students also viewed these Computer science questions
-
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...
-
Q1. How worried are clients and stakeholders in day-to- day product improvement? 2. the industrial corporation Case for Agility "The struggle is not always to the most powerful, nor the race to the...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
The following table includes transactions carried out by Ram Horn Corporation, as well as columns for each of the three categories found in the statement of cash flows: operating, financing, and...
-
Explain the reasons why recovery of interactive transactions is more difficult to deal with than is recovery of batch transactions. Is there a simple way to deal with this difficulty?
-
An electronic switching device occasionally malfunctions and may need to be replaced. It is known that the device is satisfactory if it makes, on the average, no more than 0.20 error per hour. A...
-
Suppose that in the lithium car battery example on page \(242, n\) is changed from 36 to 50 while the other quantities remain \(\mu_{0}=1600, \sigma=192\), and \(\alpha=\) 0.03. Find (a) the new...
-
You have been asked to advise a business-to-business manufacturing company how to detect fraudulent financial reporting. Management does not understand how early revenue recognition by backdating...
-
How can HRMs use metrics to measure the success of the recruiting and selection processes? List 3 metrics that you view as most relevant.
-
This exercise refers to the different versions of the GridWorld program that have been looked at previously. Identify a GridWorld class that stores a two-dimensional array that can hold objects of...
-
In Exercise 10, above, indicate all changes you would make to Pet2, Cat2, and Dog2 so that Pet2 is an interface rather than an abstract class. It should not be necessary to make any changes to...
-
What limits are there on the ability of a corporation to indemnify its directors for costs incurred in defending an action to which they were made a party only because they were directors?
-
Does your business utilize any elements of the enterprise risk management system? Explain.
-
Benito Montiego is an associate in the Division of Marketing for a container company. His team was given an assignment to develop a new line of home kitchen products made of plastic to serve as...
-
Fixed costs can significantly affect the profitability of a small business. One way to reduce fixed costs might be to outsource the company's sales and marketing functions to third parties. For...
-
On January 28, 2017, an empty LPG tanker leaving the Kamarajar Port in the State of Tamil Nadu, India, collided with an inbound tanker carrying 45,000 metric tons of oil, causing a spill of between...
-
The consumption of alcohol is illegal for Afghan citizens, but the government does allow the sale of alcohol under licence to foreigners. Use a diagram to show how such a prohibition would affect the...
-
Develop the interface standards (omitting the interface template) for the DFD in Exercise I in Chapter 5.
-
(a) Bright Sdn Bhd (BSB) is a tax resident manufacturing company in Johor, which involves in ceramic tiles. Currently, BSBs annual sales turnover has been forecasted to be around RM 300,000 for the...
-
Assume you are implementing a database from the preceding diagram. Which of these is the best way to implement the relationship identified by the number 6? a. Post the primary key of cash in cash...
-
An engineer must decide between two ways to pump concrete to the top of a seven-story building. Plan 1 requires the leasing of equipment for $60,000 initially and will cost between $0.40 and $0.95...
-
An article 4 in www.networkworld.com about evaluating e-mail filters that are designed to detect spam described a test of Mail Frontiers Anti-Spam Gateway (ASG). In the test, there were 7840 spam...
-
How does Robert Cialdini's framework of "social influence principles," including reciprocity, commitment/consistency, social proof, liking, authority, and scarcity, elucidate the subtle yet powerful...
-
In what ways do theories of cognitive dissonance, as formulated by Leon Festinger, contribute to our understanding of the psychological discomfort individuals experience when confronted with...
-
Business Law - United States Principle vs Agent, the concept of representation. What are some past legal cases (atleast 3) and law sections that outline and specify the duty of obedience as an agent?...
Study smarter with the SolutionInn App