Questions
Use the provided BingoBall.h and Set.h files to implement the Set.cpp file. //File: BingoBall.h #ifndef BINGOBALL_H...

Use the provided BingoBall.h and Set.h files to implement the Set.cpp file.

//File: BingoBall.h

#ifndef BINGOBALL_H
#define   BINGOBALL_H

#include <iostream>

class BingoBall {
public:
   BingoBall():letter{'a'}, number{0} {}
   BingoBall(char let, int num) :
       letter{ let }, number{ num } {}
   char getChar() const { return letter; }
   int getNumber() const { return number; }
   //overload == operator
   bool operator==(BingoBall &b) const { return (number == b.getNumber() && letter == b.getChar()); }
private:
   char letter;
   int number;
};

inline std::ostream& operator<<(std::ostream& out, const BingoBall& b) {
   out << b.getChar() << "-" << b.getNumber();
   return out;
}

#endif   /* BINGOBALL_H */

// File: Set.h


#ifndef SET_H
#define SET_H

#include <string>

using namespace std;

template <typename T>
class Set{
public:
   //creates an initially empy set
   Set();

   //destroys the set, deallocating any freed memory space if appropriate
   ~Set();

   //adds the element to the set (if it is not already in there)
   //returns false if element is not in universe, true otherwise
   bool addElement(const T& elem);

   //removes the specified element from set and returns the removed element, returns
   //nullpointer if the element was not in the set  
   T removeElement(const T& elem);

   //removes a random element and returns it, returns nullpointer if the set was empty initially
   T removeRandom();

   //returns true if the given element is in the set, false otherwise
   bool isIn(const T& elem) const;

   //returns true if the set is empty, false otherwise
   bool empty() const;

   //returns number of elements in the set
   int size() const;
  
private:
   //class level variable for holding an array based set implementation
   T* setArray;


    //the number of elements in the set
   int numEntries;
  
   //used for array based implementations to hold the maximum size of  
   //the array (do we need this? why or why not?)
   int arraySize;
};

// displays the entire set, solely for debugging purposes
template <typename T>
std::ostream& operator<<(std::ostream& out, Set<T>& p);

#endif /* SET_H */

In: Computer Science

Many games involve the use of dice. The singular form of dice is die. A standard...

Many games involve the use of dice. The singular form of dice is die. A standard die is a cube, i.e. a polyhedron with six sides. Each side of a die has a number of dots (or pips) on it; each side of a die is unique and contains a number of pips from 1 through 6. A die is rolled or tossed such that it comes to rest with one side randomly facing up. The die is said to have rolled a number equal to the number of pips on the side facing up.

Armed with this knowledge:

Part 1 (20%)

Implement a Java class called Die with the following features:

  • an instance variable that can store a whole number value from 1 through 6.
  • a constructor that assigns a random valid value to a die object.
  • a method that will roll a die, assigning it a new valid value.
  • a method that returns a die's value.

Part 2 (30%)

Implement a dice game called Guess wherein the player chooses a number between 2 and 12 - this is the range of possible values that can be achieved by summing the result of rolling a pair of dice. This dice game will be in its own class called Guess; it will not be in the Die class.

The game then creates two die objects and rolls them together up to three times. If the player's number comes up when summing the result of rolling the pair of dice, the player wins and the game ends. If, after three rolls of the pair of dice, the player's number has not come up, the computer wins and the game ends.

Create output charting the progress of the game and the result.

Part 3 (50%)

Implement a dice game called Matador. The Matador game will be in its own class called Matador; it will not be in the Die class or in the Guess class.

Here are the rules of Matador:

  • The game is played between the player and the computer.
  • The player's score and the computer's score each begin at 0.
  • The object of the game is to be the first reach 121 points.
  • The player and the computer take turns. On each turn:
    1. The player / computer chooses a number from 2 through 6
      • prompt the player to enter their choice on the keyboard
      • the computer should choose randomly
    2. The player / computer rolls two dice. Determine the results for the player / computer (depending on who is rolling):
    • if a 1 appears on both dice, their score is reset to 0 and it becomes the other's turn.
    • if a 1 appears on only one die, nothing is added to their score and it becomes the other's turn.
    • if a 1 does not appear on either die, the sum of the two dice is added to the roller's score.
      • if their chosen number appears on only one die, they roll again.
      • if their chosen number appears on both dice, they win.
      • if their chosen number did not appear on either die, it becomes the other's turn.

The first to reach a total score of 121 wins. Create output charting the progress of the game and the result.

Please submit:

  1. your three Java classes (source code / text files / .java extension)
  2. screenshots showing your programs in action (image files)

In: Computer Science

A fair red die and a fair green die are rolled. (a) What is the probability...

A fair red die and a fair green die are rolled.

(a) What is the probability that the sum of the numbers is even?

(b) What is the probability that the number on the red die is more than the number on the green die?

(c) What is the probability that the number on the red die is twice the number on the green die?

(d) What is the probability that the number on the red die is different from the number on the green die?

In: Statistics and Probability

Scenario: Film producer, Jack Magnet, is evaluating a script for a potential film. Based on that...

Scenario: Film producer, Jack Magnet, is evaluating a script for a potential film. Based on that script, Magnet has initially estimated the probability of the film being a hit at 0.05, average at 0.1, and the probability of it being a flop 0.85. The studio accounting department estimates that if it is a hit, the film will make $320 million in profit, with an average take profits are estimated to be $90 million, and if a flop, will lose $50 million.

Prior to deciding whether or not to produce a film, Magnet can to decide whether or not to hire a prominent film critic to review and evaluate the script. A large number of critic’s previous reviews/assessments are available, as well as the final outcome of the associated productions. Using this information, we can calculate that, given a positive review, the probability of a hit would increase to 0.12, the probability of average would be 0.18 and of a flop 0.7. If the critic issues a negative review, the probability of a hit drops to 0.03, the probability of average drops to 0.06, with flop increasing to 0.91. In addition, the probability of a positive review has been determined to be 0.25 and a negative review 0.75. The cost for the critic’s review is $100,000.

  1. Construct the associated decision tree (label decision and event nodes, and show terminal payoffs and event probabilities) and solve to determine the strategy with the highest expected net profit. State the decision strategy below the tree. (Note: can apply the associated review cost to get net profits, or use revenues and apply the costs at the appropriate decision nodes).
  1. Prior to hiring the critic, what would be the calculated EVPI based upon an evaluation of the probabilities of the film being a hit, average or a flop? (Show all calculations, not just the final answer).

In: Economics

A company produces small engines for regular cars, and it decides to produce a larger engine...

  1. A company produces small engines for regular cars, and it decides to produce a larger engine that will be used for trucks. As the company has never produced this kind of engine, a specific piston ring size needs to be purchased in order to produce the new engine. Assume that you are responsible for the procurement of that piston ring from three different suppliers. The inside diameter length of the piston has been determined as a quality characteristic with a specification of 1.500±0.009 inches. The statistical process control studies done by the suppliers have indicated that their processes are in control with the following process parameters.

Supplier 1;       X=1.500 inches

                        σx=0.003 inches

Supplier 2;       X=1.500 inches

                        σx=0.0022 inches

Supplier 3;       X=1.4950 inches

                        σx=0.0015 inches

                       

Which supplier would you purchase from, why? Explain your logic and show calculations and graphical evidence to back it up.

  1. Draw the approximate relative graphs for each supplier, assuming the diameters are normally distributed
  2. Support your answers with process capability index (Cpk) and process capability ratio (Cp) for the three suppliers?

In: Statistics and Probability

Please show neat solution that is readable. Thanks! 1. A refrigerator has a cooling liquid. Describe...

Please show neat solution that is readable. Thanks!

1. A refrigerator has a cooling liquid. Describe the stages and how energy is added or released at each stage in relationship to the 2nd law of thermodynamics.


2. You are familiar with the laws of thermodynamics in form and description. Relate any one to the process of an air-conditioning unit in a house


3. A vertical hydraulic cylinder has a piston with a diameter of 23mm, if the ambient pressure is 70 kPa, determine the mass (N) of the piston if the internal pressure is 0.3MPa.


4. Air flows through a pipe of 60cm diameter with a velocity of 0.7 m/s. If the specific volume of the air is 0.1 m3/kg determine:

The flow (m3/s)

Mass flow (kg/s)


5. Pressure in a piston system is at 120 kPa and a volume of 0.5m3 if the volume is increased to 0.75m3 what is the new pressure?


6. A volume of 0.25 m3 at a temperature of 1250C and pressure at 80kPa has the temperature increased by 200K. What is the new volume?


7. Explain the chemistry that occurs when a fuel is burnt and relate to all the laws of Thermodynamics.

In: Physics

Geoff is running a carnival game. He has 15 marbles in a bag: there are 4...

Geoff is running a carnival game. He has 15 marbles in a bag: there are 4 green marbles, 7 red marbles and 4 yellow marbles. To play a round of the game, a player randomly takes out 2 marbles (without replacement) from the bag. Green marbles win 5 points, red marbles win 1 point and yellow marbles lose 2 points.

Let X be the random variable that describes the number of points won by a player playing a single round of Geoff's marble game. Find the probability distribution for X. Give values for X as whole numbers and probabilities as decimal values to 3 decimal places. Enter the values for X in ascending order (lowest to highest) from left to right in the table.

X
P(X=x)

In: Math

A 600 kg elevator accelerates upward from rest for 10 seconds through 40.0 m. Find the...

  • A 600 kg elevator accelerates upward from rest for 10 seconds through 40.0 m. Find the cable tension.
  • a) 5130 N
  • b) 5400 N
  • c) 6360 N
  • d) 6630 N

In: Physics

Two fair dice are rolled: a) What is the probability of an even number or a...

Two fair dice are rolled:

a) What is the probability of an even number or a 3 on the first die? Are these two events mutually exclusive and why?

b) What is the probability of an even number on the first die and a 5 on the second? Is conditional probability involved in this case? Why or why not?

In: Statistics and Probability

Use a normal approximation to find the probability of the indicated number of voters. In this...

Use a normal approximation to find the probability of the indicated number of voters. In this case, assume that 187 eligible voters aged 18-24 are randomly selected. Suppose a previous study showed that among eligible voters aged 18-24, 22% of them voted.

Probability that exactly 46 voted

The probability that exactly 46 of 187 eligible voters voted is ______
​(Round to four decimal places as​ needed.)

In: Statistics and Probability