1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andru [333]
3 years ago
6

Each week, the Pickering Trucking Company randomly selects one of its 30 employees to take a drug test. Write an application tha

t 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.

Computers and Technology
1 answer:
Sati [7]3 years ago
3 0

Answer:

Following are the program to this question:

import java.util.*; //import package

public class Main //defining class

{

 public static void main(String[] args) //defining main method

 {

   int testedEmployee; //defining integer variable

   for(int i = 1;i<=52;i++) //defining loop that counts from 1 to 52  

   {

     testedEmployee = 1 + (int) (Math.random() * 30); //using random method that calculate and hold value

     System.out.print(testedEmployee+"\t"); //print value

     if(i%4 == 0)//defining codition thats checks value is divisiable by 4  

     {

       System.out.println(); //print space

     }

   }

 }

}

Output:

please find the attachment.

Explanation:

In the given java program, a class Main is declared, inside the class, the main method is declared, in which an integer variable "testedEmployee", is declared, in the next line, the loop is declared, that can be described as follows:

  • Inside the loop, a variable "i" is declared, which starts from 1 and stop when its value is 52, inside the loop a random method is used, that calculates the random number and prints its value.
  • In the next step, a condition is defined, that check value is divisible 4 if this condition is true, it will print a single space.

You might be interested in
A(n) ___ operating system is a very fast, relatively small os. it is designed to respond to hardware and program requests almost
nataly862011 [7]
<span>A real-time operating system is a very fast, relatively small os. it is designed to respond to hardware and program requests almost instantly.</span>
3 0
2 years ago
In the 1760s and early 1770s, the British government wanted to raise money by taxing the residents of its colonies in North Amer
Virty [35]

Answer: The Boston Tea party was when American colonists dumped tea into the Boston Harbor because they were mad at the British for taxing their tea.

Explanation: This started the Revolutionary War because it was the first big act of wanting a revolution from the American colonists.

4 0
2 years ago
A Windows user has been successfully saving documents to the file server all morning. However, the latest attempt resulted in th
Natalka [10]

Answer:

c. The share to the file server is disconnected.

Explanation:

Sharing a file to the file server is the same as saving the document to the file server as the most important function of file server is storage. Therefore if one is getting an error message of not being able to find the saved file and to verify the location of '\\FileServer\Docs', it means that the saved files are no longer available anywhere on the server and even in the computer of the user.

8 0
3 years ago
Read 2 more answers
A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
denis-greek [22]

Answer:

The computer will store 8.05 *10^10 bytes of information.

Explanation:

This is the same as saying that the computer will now have 80.51 Gigabytes ( 1gb = 1.000.000.000 bytes) of storage. In this case, the number is represented in its decimal form, and the previous one is displayed in Scientific Notation.

8 0
2 years ago
While researching ideas for cutting energy costs is his company. Hector watches an online video in which a business expert says,
Nataliya [291]
B. Put it in quotes if it is directly quoted as is and cite the source. You should likely also list the source in the works cited but not the phrase itself.
6 0
2 years ago
Read 2 more answers
Other questions:
  • The North American Free Trade Agreement (NAFTA) among Canada, Mexico, and the United States is intended to _____.
    5·2 answers
  • Your computer is configured to obtain an ipv4 address and dns server address automatically. what utility will help you to find t
    7·1 answer
  • Which of the following domain types is most trustworthy 1) .com 2) .tv 3).org 4) .edu
    15·2 answers
  • Why should you log out when you finish an online session?
    9·1 answer
  • he fundamental building block in every Hypertext Markup Language (HTML) document is the _____ tag, which marks a component in th
    7·1 answer
  • Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
    6·2 answers
  • If you want to insert a column into an existing table, what would you do?
    13·2 answers
  • Importance of computer​
    15·1 answer
  • Consider the following correct implementation of the selection sort algorithm.
    5·1 answer
  • Which of the following keywords allows a subclass to access a superclass method even when the subclass has overridden the superc
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!