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
Why isn't 802.1X a good choice for home based wireless networks
Sholpan [36]
It can possibly cause an issue with the authenticator's end. Its capacity has a limited memory capacity and has the minimal processing power. Most of the process will be at the supplicant and authentication servers. However, the 802.1X has a better security compared to the WEP.
6 0
3 years ago
Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics
svp [43]

It should be noted that the intention for the creation of the internet was simply for resources sharing.

The motivation behind the creation of the internet was for resources sharing. This was created as a tool for academics and federal problem-solvers.

It transpired as it wasn't for its original purpose anymore. Its users employed it for communication with each other. They sent files and softwares over the internet. This led to the security vulnerabilities that can be seen today.

Learn more about the internet on:

brainly.com/question/2780939

5 0
3 years ago
In access, the columns in a table are called?
liubo4ka [24]
All tables are composed of horizontal rows and vertical columns, with small rectangles called cells in the places where rows and columns intersect. In Access, rows and columns are referred to as records and fields. A field is a way of organizing information by type.
6 0
3 years ago
There u go i did thereeeeeeeeeeeeeeeeeeeeeee
Alika [10]
Awwww u cutie pie:)) thanks for showing me how to screenshot
3 0
3 years ago
Read 2 more answers
How to transfer photos from iphone to computer
SSSSS [86.1K]
If you’re using a Windows computer, the best way to transfer photos from your iPhone to your computer is via USB cable.
First, plug your phone into your computer using the phone’s USB Cable. The Photo app should launch automatically then click the Import button. Check to select the photos you wish to transfer. Once you checked all the photos you wish to transfer, click on Continue. Click Import to start the transfer.
3 0
3 years ago
Other questions:
  • What does CSS stand for?
    8·2 answers
  • Which of the following was the first commercial software package to incorporate WYSIWYG as a feature?
    15·1 answer
  • My computer have black spots and line
    7·2 answers
  • Gave me six external part of the computer system and identify which is the output and input devices
    12·1 answer
  • When you select a state abbreviation from a combo box, how does the form control record your selection?
    8·1 answer
  • Does anyone know the answer to this question
    9·1 answer
  • What is interest? How does interest affect credit card purchases?
    11·1 answer
  • In the context of machine learning, an artificial neural network (ANN) is most likely used for:a.supplying explanations for solu
    9·1 answer
  • NEEDED ASAP
    12·1 answer
  • Nilsu is attempting to train a new administrative assistant on using a word processing program. Since the program is fairly comp
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!