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
List three ways you can help somone who is being cyber bullied instead of just being a bustander​
JulsSmile [24]
Tell an adult
give them moral support
help them stand up for themselves
4 0
3 years ago
Read 2 more answers
What classification term is used to describe games made with huge development
Ludmilka [50]

Explanation:

yhddhhdhsudhenndjeieoeknenejej

8 0
2 years ago
You are a part-time manager for The Mobile Vegan, a food truck catering to vegan diners in Portland, Oregon. Jessica Rosen, the
Nesterboy [21]

Answer:

i acc dont know

Explanation:

srry

5 0
3 years ago
What is the basic difference between x.509 and pgp in terms of key hierarchy and key trust?
ra1l [238]
In terms of key hierarchy, you have to request to a Certification Authority in order for them to issue you an X.509 certificate. On the other hand, you can creat your own pgp.

In terms of key trust, X.509 supports only a sole key owner. It can support only one digital signature to confirm the key's validity. This does not work for pgp.
3 0
3 years ago
Critical Thinking Questions
Pani-rosa [81]

Answer:

Explanation:

1) Assassins Creed Valhalla. The developers (ubisoft?) is canadian i think. The culture of ACV is of the vikings. Some advantages would be many people could learn about viking culture but some concerns is since it may not be the developers culture some information could be wrong and many people could be misinformed

2) personally i would put them in the order of Asteroid, Pac Man, then modern warfare.

this is all i really know sorry

but i hope this helps <3

8 0
2 years ago
Read 2 more answers
Other questions:
  • 11.
    11·1 answer
  • Why are hardline Ethernet connections always faster than WiFi?
    8·1 answer
  • [20 pts] Assume that Bob wants to send a secret message to Alice using RSA encryption. (a) [5pts] (Key generation step) Assume A
    8·1 answer
  • How much electricity is in the human brain? ​
    8·2 answers
  • Janice usually works on a particular workbook that contains all business related data. She decides to keep a backup of all the d
    7·2 answers
  • Someone hacked into an employee's computer and erased all of their data. All data for the past three weeks was lost as that was
    8·1 answer
  • Name the different views in word​
    5·1 answer
  • The variable planet_distances is associated with a dictionary that maps planet names to planetary distances from the sun. Write
    12·1 answer
  • 1. I write about my travel experiences on my own personal ____?
    12·1 answer
  • Write a C++ function with the following signature: void readAndConvert() The function takes no parameters and returns no value.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!