Questions
SUMMARY Using Java’s Generics framework, make two classes… one that stores 2 items of any given...

  1. SUMMARY
  1. Using Java’s Generics framework, make two classes… one that stores 2 items of any given type (Pair) and one that stores 3 items of any given type (Triple). Then use the triple value class to store the win & loss records of multiple football teams (or any sport) in an array. Next loop through array and calculate the winning percentage of each team and add team name and win % to a pair class, and then add that instance to another array. Finally print out all team entries in the pair array with their win percentages and state which team has the greatest win percentage.
  1. This lab will involve the following new features:
    1. Generics
  1. DETAILS
  1. Generic classes: You’ll make two classes similar to what we did in class.
    1. One class is the Pair class just like from class, and the other will be a Triple class and will have one more parameter, so A,B,C in the Triple class.
  2. In your main class, you will create at least 5 instances of the Triple class, and in each one store:
    1. Team name – String
    2. Wins – int
    3. Losses – int
  3. Create an array of this Triple generic class type and store these 5 instances in the array.
    1. Here is a guide on creating an array of generic types:

Triple<String,Integer,Integer>[] aoTriple;

aoTriple = new Triple[5];

  1. Now create another array of Pair type that is 5 in length.
  2. Create a for loop and loop through the Triple array.
    1. For each item, calculate the win percentage and create new Pair object of <String,Double> type and place following values in each Pair object:
      1. Team name – String
      2. Winning percentage – double (e.g. .67) – this has to be calculated as opposed to just typing it into code!
        1. NOTE: Winning percentage has to be calculated by dividing wins by total games and can just be stored as a decimal… e.g. .85
        2. IMPORTANT: Int to double note – for each item, you need to cast the wins and losses (int) into double types before doing the above avg math. And you will store the avg in a double.

Remember: casting works like this… (double)aoTriple[x].getSecond()

  1. Print out results:
    1. Finally create a for loop to loop through Pair array and print out the values of each object (team name and win %).
    2. IMPORTANT: Also print out which team has the highest win % by figuring out mathematically.

In: Computer Science

Each of the following represents a change from an adult pronunciation to a child's pronunciation.


Each of the following represents a change from an adult pronunciation to a child's pronunciation. By comparing the adult pronunciation with the child's pronunciation, identify the phonetic processes that have occurred in the child's form of the word. There are at least two processes for each item.

 Word Adult Pronunciation Child's Pronunciation Phonetic Processes

 a. drain

 b. shape

 c. elevator

image.png

In: Psychology

At a certain coffee​ shop, all the customers buy a cup of coffee and some also...

At a certain coffee​ shop, all the customers buy a cup of coffee and some also buy a doughnut. The shop owner believes that the number of cups he sells each day is normally distributed with a mean of 340 cups and a standard deviation of 18 cups. He also believes that the number of doughnuts he sells each day is independent of the coffee sales and is normally distributed with a mean of 180 doughnuts and a standard deviation of 16.

a) The shop is open every day but Sunday. Assuming​ day-to-day sales are​ independent, what's the probability​ he'll sell over 2000 cups of coffee in a​ week?

__________________ ​(Round to three decimal places as​ needed.)

The daily exchange rates for the​ five-year period 2003 to 2008 between currency A and currency B are well modeled by a normal distribution with mean 1.798 in currency A​ (to currency​ B) and standard deviation 0.047 in currency A. Given this​ model, and using the​ 68-95-99.7 rule to approximate the probabilities rather than using technology to find the values more​ precisely, complete parts​ (a) through​ (d).

a) What would the cutoff rate be that would separate the highest 16​% of currency​ A/currency B​ rates?

The cutoff rate would be ______________

​(Type an integer or a decimal rounded to the nearest thousandth as​ needed.)

The daily exchange rates for the​ five-year period 2003 to 2008 between currency A and currency B are well modeled by a normal distribution with mean 1.425 in currency A​ (to currency​ B) and standard deviation 0.026 in currency A. Given this​ model, and using the​ 68-95-99.7 rule to approximate the probabilities rather than using technology to find the values more​ precisely, complete parts​ (a) through​ (d).

​a) What is the probability that on a randomly selected day during this​ period, a unit of currency B was worth less than 1.425 units of currency​ A?

The probability is _____________%

​(Type an integer or a​ decimal.)

In: Statistics and Probability

A data set has 1000 observations. In the data, a quantitative variable's highest value is 780...

A data set has 1000 observations. In the data, a quantitative variable's highest value is 780 and its lowest value is 95. a) How many number of classes would you recommend? b) What is the class interval that you would recommend?

In: Statistics and Probability

You have been given 60 balls, which are labelled as 1,2,3...,60 respectively a. What is the...

You have been given 60 balls, which are labelled as 1,2,3...,60 respectively

a. What is the probability of pulling out a number that is a multiple of 7 provided the pulled number is an even one ?

b. What is the probability of drawing a number that is a multiple of 4 given the fact that the drawn number is a multiple of 3?

In: Statistics and Probability

Q1. Consider a pot containing balls. Each ball has a number painted on it with the...

Q1. Consider a pot containing balls. Each ball has a number painted on it with the number ranging from 1 to 9. For 1<=n<=9 there are n balls with the number n painted on it. For each number i where i lies between 1 and 9, write down the probability that a ball drawn at random from the pot has the number i painted on it.

Q2) Put 3 balls into 3 boxes randomly. Find 1) Probability that there is just one ball in each box. 2) The Probability that there is one empty box

In: Statistics and Probability

The answer should be in JAVA. You will design and implement two classes to support a...

The answer should be in JAVA.

You will design and implement two classes to support a client program, RockPaperScissorsGame.java, to simulate Rock-Paper-Scissors game.

Read and understand the client program to find out the requirements for the HandShape and Player classes.

The rules of the Rock-Paper-Scissors game are:

    Scissors✌️ beats Paper✋ that beats Rock✊ that beats Scissors✌️

Additionally, to simplify the game logic (and complexify a little bit the HandSahpe class) , two players cannot show the same hand shape.

The followings are some sample runs:

$java RockPaperScissorsGame
Alice shows Paper
Bob shows Scissors
Bob wins!


$java RockPaperScissorsGame
Alice shows Paper
Bob shows Rock
Alice wins!


$java RockPaperScissorsGame
Alice shows Scissors
Bob shows Rock
Bob wins!

RockPaperScissorsGame.java

public class RockPaperScissorsGame {

        public static void main(String[] args) {
                
                String[] handShapeName = {"Rock", "Paper", "Scissors"};
                
                HandShape handShape = new HandShape();
                
                Player player1 = new Player("Alice");
                Player player2 = new Player("Bob");

                System.out.println(player1.getName() + " shows " + handShapeName[player1.showHand(handShape)]);
                System.out.println(player2.getName() + " shows " + handShapeName[player2.showHand(handShape)]);         
                
                System.out.println(player1.findWinner(player2) + "  wins!");
        }
}

In: Computer Science

The answer should be in JAVA. You will design and implement two classes to support a...

The answer should be in JAVA.

You will design and implement two classes to support a client program, RockPaperScissorsGame.java, to simulate Rock-Paper-Scissors game.

Read and understand the client program to find out the requirements for the HandShape and Player classes.

The rules of the Rock-Paper-Scissors game are:

    Scissors✌️ beats Paper✋ that beats Rock✊ that beats Scissors✌️

Additionally, to simplify the game logic (and complexify a little bit the HandSahpe class) , two players cannot show the same hand shape.

The followings are some sample runs:

$java RockPaperScissorsGame
Alice shows Paper
Bob shows Scissors
Bob wins!


$java RockPaperScissorsGame
Alice shows Paper
Bob shows Rock
Alice wins!


$java RockPaperScissorsGame
Alice shows Scissors
Bob shows Rock
Bob wins!

RockPaperScissorsGame.java

public class RockPaperScissorsGame {

        public static void main(String[] args) {
                
                String[] handShapeName = {"Rock", "Paper", "Scissors"};
                
                HandShape handShape = new HandShape();
                
                Player player1 = new Player("Alice");
                Player player2 = new Player("Bob");

                System.out.println(player1.getName() + " shows " + handShapeName[player1.showHand(handShape)]);
                System.out.println(player2.getName() + " shows " + handShapeName[player2.showHand(handShape)]);         
                
                System.out.println(player1.findWinner(player2) + "  wins!");
        }
}

In: Computer Science

In an experiment in my laboratory, I used siRNA to decrease the amounts of a HDAC...

In an experiment in my laboratory, I used siRNA to decrease the amounts of a HDAC that removes the H3K9ac mark. What observations would I expect in terms of changes in gene expression?

In: Biology

write a c++ member function that removes the FIRST OCCURENCE of a SPECIFIC ELEMENT in a...

write a c++ member function that removes the FIRST OCCURENCE of a SPECIFIC ELEMENT in a linked list. After attemtped removal return the SIZE of the linked lost whether or not the removal was successful.

In: Computer Science