Question: Each week, the Pickering Trucking Company randomly selects one of its 30 employees to take a drug test. Write an application that determines which employee
Each week, the Pickering Trucking Company randomly selects one of its 30 employees to take a drug test. Write an application that determines which employee will be selected each week for the next 52 weeks. Use the Math. random() function explained in Appendix D to generate an employee number between 1 and 30; you use a statement similar to:
testedEmployee = 1 + (int) (Math.random() * 30);
After each selection, display the number of the employee to test. Display four employee numbers on each line. It is important to note that if testing is random, some employees will be tested multiple times, and others might never be tested. Run the application several times until you are confident that the selection is random. Save the file as DrugTests.java.
Step by Step Solution
3.55 Rating (169 Votes )
There are 3 Steps involved in it
public class DrugTests public st... View full answer
Get step-by-step solutions from verified subject matter experts
