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
Which type of software-generated problems can indicate that a software bug is causing a memory error?
Katena32 [7]
The type of software-generated problems that can indicate that a software bug is causing a memory error are page fault, exception error and general-protection fault. Registry errors show that there are parts of the registry that were written to the faulty parts of the RAM. An erroneous memory count would happen when there is incompatibility in the installation.
3 0
3 years ago
Is there a way I can put an already made sound that i created over an already made video
lys-0071 [83]
If you're using an apple product to do video editing, then iMovie is probably the best way to do that.

If you're on Windows and you're looking for a free video editing website, I'd suggest WeVideo. Although WeVideo does add watermarks to your videos, editing is pretty easy when using it.
6 0
3 years ago
# 12/9/2020
EastWind [94]

where it says   " def main() " there needs to be something in the "()"

Hope this helps.   : )

3 0
2 years ago
An online retailer has developed an algorithm to provide personalized recommendations to shoppers. Which form of IPR protects th
Helen [10]

Answer:

should be B.

Explanation:

If not then Im sorry

5 0
2 years ago
Why can't I access my micro SD card on my Lenovo ThinkPad Yoga 11e? I'm trying to export some PNG files onto my Micro SD card, s
BabaBlast [244]

maybe you need a new sd card

6 0
3 years ago
Other questions:
  • Which information is considered free for use?
    9·2 answers
  • ​For complex models, analysts can choose computer-based modeling tools that use _____, which includes standard shapes and symbol
    10·1 answer
  • The difference between a for loop and a while loop is that a for loop is a loop that happens for a certain number of times. A wh
    14·1 answer
  • 1. The global economy involves trading between people from different _____
    8·1 answer
  • In C complete the following:
    12·1 answer
  • Tara is creating a presentation for her science project about volcanoes. She added different animations to every slide for empha
    12·1 answer
  • Write a program that reads a file that contains only integers, but some of the integers have embedded commas, as in 145,020. The
    10·1 answer
  • 1. Separate valid and invalid variables:
    9·1 answer
  • How can we avoid falling victim to a phishing or pharming scheme
    14·1 answer
  • What is the difference between referential and entity integrity
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!