Method Acting
Methods can be used to accomplish each of the following tasks. Write only the
method headers for each example. Overload a method name, if appropriate.
a. Calculate the largest of 2, 3, or 4 integer values.
b. Calculate your federal income tax percentage based on the following chart:
Adjusted Gross Income Range | Percentage | ||
$0 | − | $7,300.00 | 10% |
$7,300.01 | − | $29,700.00 | 15% |
$29,700.01 | − | $71,950.00 | 25% |
$71,950.01 | − | $150,150.00 | 28% |
$150,150.01 | − | $326,450.00 | 33% |
$326,450.01 | − | and up | 35% |
Allow the income to be expressed in dollars and cents, or simply rounded to the
nearest thousand dollars. That is, an adjusted gross income of 52,736.98 may alternatively be expressed as 53.
c. Calculate the percentage score on an exam. You are given the number of questions on the exam, and the number that are correct.
d. Calculate your risk factor (RF) for auto insurance in MA, NY, and NJ. Your risk factor is either a, b, c, d, or e. In MA, RFdepends on your age, the number of charged accidents on your record, and the number of traffic violations. In NY, RFdepends on your age, your driving points (an integer between 6 and 35, inclusive), and the total dollars paid out to you in charged accident claims. In NJ, RFdepends on your age, the distance from your home to the NY border (rounded to the nearest mile), the number of traffic violations on your record, and the number of people under 30 years of age in your family.
e. Decide whether or not you are eligible to become president. Eligibility is determined by your year of birth, the first letter of the country in which you were born, and the number of years that you have been a U.S. resident.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.