Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 = 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);
Step by Step Solution
★★★★★
3.36 Rating (146 Votes )
There are 3 Steps involved in it
Step: 1
import javautilScanner public class EmployeeBonus public static ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started