Concept explainers
a.
Explanation of Solution
Program:
File name: “DrugTests2.java”
//Define a class named DrugTests2
public class DrugTests2
{
//Define a main method
public static void main(String[] args)
{
//Declare the variables and initialize the values
int testedEmployee;
int week;
final int WEEKS = 52;
final int EMPLOYEES = 30;
int[] counts = new int[EMPLOYEES];
int countNeverTested = 0;
int x;
/*For loop to be executed until a list of randomly
selected employees who will be tested each
week for the next 52 weeks*/
for(week = 1; week <= WEEKS; ++week)
{
//Calculate the number of times each employee is selected
testedEmployee = 1 + (int) (Math.random() * EMPLOYEES);
//Print the result
System.out.print("week " + week + " Emp # " +
testedEmployee + " ");
//If remainder of week % 4 equals 0
if(week % 4 == 0)
//Print the result
System.out.println();
//Increment counts
counts[testedEmployee - 1]++;
}
//For loop to be executed until x exceeds 30
for(x = 0; x < EMPLOYEES; ++x)
{
//Print the result
System...
b.
Explanation of Solution
Program:
File name: “DrugTests3.java”
//Define a class named DrugTests3
public class DrugTests3
{
//Define a main method
public static void main(String[] args)
{
//Declare the variables and initialize the values
int testedEmployee;
int week;
final int WEEKS = 52;
final int EMPLOYEES = 30;
int[] counts = new int[EMPLOYEES];
int countNeverTested = 0;
int x;
int previousEmployee = -1;
/*For loop to be executed until a list of randomly
selected employees who will be tested each
week for the next 52 weeks*/
for(week = 1; week <= WEEKS; ++week)
{
/*Calculate the number of times each employee is selected*/
testedEmployee = 1 + (int) (Math.random() * EMPLOYEES);
/*If an employee number is selected
immediately after it was already selected*/
if(testedEmployee == previousEmployee)
{
//Decrement week
week--;
//Print the result
System.out.println("Employee #" + testedEmployee + " was selected two weeks in a row -- making new selection");
}
//Else
else
{
//Print the result
System.out.print("week " + week + " Emp # " +
testedEmployee + " ");
//If remainder of week % 4 equals 0
if(week % 4 == 0)
//Print the result
System...
Trending nowThis is a popular solution!
- solve and show the tree on paperarrow_forwardI need help to resolve the following activityarrow_forwardModern life has been impacted immensely by computers. Computers have penetrated every aspect of oursociety, either for better or for worse. From supermarket scanners calculating our shopping transactionswhile keeping store inventory; robots that handle highly specialized tasks or even simple human tasks,computers do much more than just computing. But where did all this technology come from and whereis it heading? Does the future look promising or should we worry about computers taking over theworld? Or are they just a necessary evil? Provide three references with your answer.arrow_forward
- What are the steps you will follow in order to check the database and fix any problems with it? Have in mind that you SHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answerarrow_forwardYou are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answerarrow_forward(A) A cellular system has 12 microcells with 10 channels per cell. The microcells are split into 3 microcells, and each microcell is further split into 4 picocells. Determine the number of channels available in system after splitting into picocelles.arrow_forward
- Question 8 (10 points) Produce a relational schema diagram that corresponds to the following ER diagram for a Vacation Property Rentals database. Your relational schema diagram should include primary & foreign keys. Upload your relational schema diagram as a PDF document. Don't forget that the relation schemas for "Beach Property" and "Mountain Property" should each have primary keys. FYI: "d" in this notation denotes a subclass. Figure 2: ER Diagram for Question 8 id first RENTER name middle last address phone email 1 signs N id begin date RENTAL AGREEMENT end date amount N street address books city id 1 state address num. rooms PROPERTY zip code base rate type propertyType blocks to beach activity "B" "M" BEACH PROPERTY MOUNTAIN PROPERTYarrow_forwardNotes: 1) Answer All Question, 2) 25 points for each question QI Figurel shows the creation of the Frequency Reuse Pattern Using the Cluster Size K: (A) illustrates how i and j can be used to locate a co-channel cell. huster 3 Cluster Cluster 2 X=7(i=2,j1)arrow_forwardYou are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following taking the database offline is not allowed since people are connected to it and how personal data might be bridged and not secured.Provide three references with you answer.arrow_forward
- You are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answerarrow_forwardYou are called by your supervisor to go and check a potential data bridge problem. What are the stepsyou will follow in order to check the database and fix any problems with it? Have in mind that youSHOULD normalize it as well. Describe in full, consider the following:• Taking the database offline is not allowed since people are connected to it.• Personal data might be bridged and not secured. Provide three refernces with you answer from websitesarrow_forwardModern life has been impacted immensely by computers. Computers have penetrated every aspect of oursociety, either for better or for worse. From supermarket scanners calculating our shopping transactionswhile keeping store inventory; robots that handle highly specialized tasks or even simple human tasks,computers do much more than just computing. But where did all this technology come from and whereis it heading? Does the future look promising or should we worry about computers taking over theworld? Or are they just a necessary evil? Provide three references with your answer.arrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,