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
When you compile your program, the compiler identifies the logic errors and suggests how to correct them?
Rainbow [258]
Nope. You're on your own to find them and fix them. This why testing is so important, otherwise they won't show up until the customer finds them and that's embarrasing.
6 0
4 years ago
What is cutting-edge technology
stira [4]

Answer:

Cutting-edge technology refers to technological devices, techniques or achievements that employ the most current and high-level IT developments; in other words, technology at the frontiers of knowledge. Leading and innovative IT industry organizations are often referred to as "cutting edge."

Explanation:

8 0
3 years ago
Dim Inventory() as Integer = {357, 126, 220}Call Stock(Inventory(2),Me.lblOutput)Sub Stock (ByVal Number As Integer, ByRef lblLa
aalyn [17]

Answer:

The answer is "Option c".

Explanation:

In the given visual basic code, an integer array "Inventory" is declared, that includes 3 elements, that are "357, 126, and 220". In the next line, a call stock function is used, in the function, the array is passed as a parameter and in array parameter, the index value that is "2" is passed. This function use label to print array index value, that is "220". and other options are incorrect that can be described as follows:

  • Option a and Option b both are wrong because array indexing always starts with 0 and ends with n-1, and in this array, it will take index value 2, which is not equal to 357 and 126.

6 0
3 years ago
Information such as audio or video files are broken down into
liberstina [14]
...packets. I hope this helps.
5 0
3 years ago
Which of the following is not a basic computer operation? A. Processing B. Input C. Throughput D. Storage
andrew11 [14]
Throughput I think.....
3 0
3 years ago
Read 2 more answers
Other questions:
  • When configuring an adsl installation where should you to install the dsl filters?
    7·1 answer
  • To maintain audience interest in a multimedia presentation, use animations or transition features to control when objects or tex
    13·1 answer
  • When numbers are changed in cells that are involved in formula is the formulas are automatically
    14·1 answer
  • Consider the following scheduling problem. You are given a list of final exams F1,...,Fk tobescheduled,andalistofstudentsS1,...,
    10·1 answer
  • What home ribbon group contains the command used for quickly converting selected cells to a table by choosing a table style?
    10·1 answer
  • What is the memory of a computer called
    12·2 answers
  • Katarina is deciding whether to buy a desktop or a laptop computer. What will most likely help Katarina make her decision?
    10·2 answers
  • If we collect data on the number of wins each team in the NFL had during the 2011-12 season, we have _____________ data.
    10·1 answer
  • 4) Tables in HTML are the attractive way of representing information in the form of rows and WMS.
    15·1 answer
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!