Understanding Nested if Statements In this lab, you complete a prewritten Java program that calculates an...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Understanding Nested if Statements In this lab, you complete a prewritten Java program that calculates an employee's productivity bonus and prints the employee's name and bonus. Bonuses are calculated based on an employee's productivity score as shown below. A productivity score is calculated by first dividing an employee's transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked. Productivity Score Bonus <=30 31-69 70-199 >= 200 $50 $75 $100 $200 Instructions 1. Ensure the file named Employee Bonus.java is open. 2. Variables have been declared for you, and the input statements and output statements have been written. Read them over carefully before you proceed to the next step. 3. Design the logic, and write the rest of the program using a nested if statement. EmployeeBonus.java 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 // Declare and initialize variables here. String employeeName; double numTransactions; String transactString; double numShifts; String shiftString; double dollarValue; String dollarString; double score; double bonus; final double BONUS_1= 50.00; final double BONUS_2= 75.00; final double BONUS_3= 100.00; final double BONUS_4 = 200.00; // This is the work done in the housekeeping() method System.out.println("Enter employee's name: "); employeeName = s.nextLine(); System.out.println("Enter number of shifts: "); shiftString = s.nextLine(); System.out.println("Enter number of transactions: "); transactString = s.nextLine(); System.out.println("Enter transactions dollar value: "); dollarString = s.nextLine(); numShifts Double.parseDouble(shiftString); numTransactions = Double.parseDouble(transactString); dollarValue = Double.parseDouble (dollarString); // This is the work done in the detailLoop() method // Write your code here // This is the work done in the endOfJob() method // Output. System.out.println("Employee Name: " + employeeName); System.out.println("Employee Bonus: $" + bonus); Understanding Nested if Statements In this lab, you complete a prewritten Java program that calculates an employee's productivity bonus and prints the employee's name and bonus. Bonuses are calculated based on an employee's productivity score as shown below. A productivity score is calculated by first dividing an employee's transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked. Productivity Score Bonus <=30 31-69 70-199 >= 200 $50 $75 $100 $200 Instructions 1. Ensure the file named Employee Bonus.java is open. 2. Variables have been declared for you, and the input statements and output statements have been written. Read them over carefully before you proceed to the next step. 3. Design the logic, and write the rest of the program using a nested if statement. EmployeeBonus.java 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 // Declare and initialize variables here. String employeeName; double numTransactions; String transactString; double numShifts; String shiftString; double dollarValue; String dollarString; double score; double bonus; final double BONUS_1= 50.00; final double BONUS_2= 75.00; final double BONUS_3= 100.00; final double BONUS_4 = 200.00; // This is the work done in the housekeeping() method System.out.println("Enter employee's name: "); employeeName = s.nextLine(); System.out.println("Enter number of shifts: "); shiftString = s.nextLine(); System.out.println("Enter number of transactions: "); transactString = s.nextLine(); System.out.println("Enter transactions dollar value: "); dollarString = s.nextLine(); numShifts Double.parseDouble(shiftString); numTransactions = Double.parseDouble(transactString); dollarValue = Double.parseDouble (dollarString); // This is the work done in the detailLoop() method // Write your code here // This is the work done in the endOfJob() method // Output. System.out.println("Employee Name: " + employeeName); System.out.println("Employee Bonus: $" + bonus);
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class EmployeeBonus public static ... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
? ????????? 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 50 Use your 44 use is 45 46 47 48 49 Made sales of product Cost for the inventory that was sold Amount of the invoice (above) that returns and...
-
123456789 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 200 210 230 260 280 200 210 230 260 280 Twenty-four individuals were analyzed for 2 microsatellite markers. The experiment involved DNA...
-
In this lab you are synthesizing acetylsalicylic acid (ASA) from salicylic acid using acetic anhydride, with phosphoric acid as a catalyst. If the amount of salicylic acid at the start of the...
-
Assume that a patient has 80 percent coverage for medical services but no coverage for prescription drugs. An 80 percent drug benefi t is added. Show graphically what will happen to the relative...
-
A solid round bar with diameter of 2 in has a groove cut to a diameter of 1.8 in, with a radius of 0.1 in. The bar is not rotating. The bar is loaded with a repeated bending load that causes the...
-
During its first year of operations, Energy Company SE had credit sales of 3,000,000; 600,000 remained uncollected at year-end. The credit manager estimates that 28,000 of these receivables will...
-
Hercules Workout World gains a client who prepays \($630\) for a package of six physical training sessions. Hercules Workout World collects the \($630\) in advance and will provide the training...
-
The following condensed balance sheet is for the partnership of Hardwick, Saunders, and Ferris, who share profits and losses in the ratio of 4:3:3, respectively: The partners decide to liquidate the...
-
Given the following information 1. Sales Price should be calculated using Year Net Operating Income capped at 5% 2. Cost of Sale is 5% Question: What is the Projected Sales Price Year 1 2 3 4 5 6...
-
What characterizes someone who views shopping as a form of entertainment (Tables 1B through 7B)? Which factors contribute most? How do your findings relate to the information presented in Consumer...
-
If a foreign corporation that is a per se corporation pays an income tax to the country in which it is organized, then A - Assuming no subpart F income, there is no foreign tax credit eligibility...
-
1. What are some of the best practices that are helping Chobani with successful product launches? 2. Are any of these relevant for Oatly 3. What are the opportunities Oatly to have better product...
-
1: What court case ruled that public funding can be allocated for bussing children to private religious schools? 2: What Supreme Court case upheld a state regulation that prohibited boys younger than...
-
One of the issues that seems to trouble students of Business Law is the concept of a unilateral versus a bilateral contract. On the surface, they seem quite clear, so many students do not spend the...
-
Assume 8 % discount rate Year 0 , 1 , 2 , 3 Cash flow - 2 5 0 0 0 , 8 0 0 0 , 1 0 , 0 0 0 , 1 2 0 0 0 What is irr? What is NPV ? What is profitability index? What is payback?
-
Young Company expected to incur $12,000 in manufacturing overhead costs and use 4,000 machine hours for the year. Actual manufacturing overhead was $9,900 and the company used 4,350 machine hours. 9....
-
Describe a situation or circumstance that demonstrated lack of technical leadership, professionalism, or ethics that you have encountered (personally or indirectly) over the past several years. These...
-
Write out the formula for the total costs of carrying and ordering inventory, and then use the formula to derive the EOQ model. Andria Mullins, financial manager of Webster Electronics, has been...
-
Nelson operates a placement service for companion-sitting for the elderly. He placed Martha Jackson with Mrs. Mock, an elderly woman who needed a person to assist with her personal needs, household...
-
Which act sets the minimum wage, and what is the current wage rate?
-
What is the difference between "engaged to wait" and "waiting to be engaged" as far as working time?
-
A pair of \(20^{\circ}\) full involute spur gears having 40 and 60 teeth of module \(4 \mathrm{~mm}\) are in mesh. The smaller gear rotates at \(1440 \mathrm{rpm}\). Find (a) sliding velocity at...
-
Calculate the minimum number of teeth on a pinion to avoid interference to have a speed ratio of 2.5:1. The pressure angle is \(20^{\circ}\) and addendum of one module of gear may be used.
-
The path of contact in involute gears is (a) a straight line (b) involute path (c) curved path (d) circle.
Study smarter with the SolutionInn App