Questions
JAVA!!!! int[][] BingoCardArray = new int[5][5]; Use a nested for-loop, to populate the 2-D array representing...

JAVA!!!!

int[][] BingoCardArray = new int[5][5];

Use a nested for-loop, to populate the 2-D array representing 5 columns for B – I – N – G – O, where
row 1 =
        col 1 = random # 1- 15
        col 2 = random # 16 – 30
        col 3 = random # 31 – 45
        col 4 = random # 46 – 60
        col 5 = random # 61 – 75

row 2 =
        col 1 = random # 1- 15
        col 2 = random # 16 – 30
        col 3 = random # 31 – 45
        col 4 = random # 46 – 60
        col 5 = random # 61 - 75

row 3 =
        col 1 = random # 1- 15
        col 2 = random # 16 – 30
        col 3 = random # 31 – 45
        col 4 = random # 46 – 60
        col 5 = random # 61 – 75

row 4 =
        col 1 = random # 1- 15
        col 2 = random # 16 – 30
        col 3 = random # 31 – 45
        col 4 = random # 46 – 60
        col 5 = random # 61 - 75

row 5 =
        col 1 = random # 1- 15
        col 2 = random # 16 – 30
        col 3 = random # 31 – 45
        col 4 = random # 46 – 60
        col 5 = random # 61 – 75


The playGame()method in the BingoGame (Driver) class will loop to generate 50 random numbers in the range of 1 to 75.  This simulates drawing 50 numbers in a BINGO game.  The method will pass the number to a method, checkBingo()in the domain class, BingoCard, which will check if the number received as a parameter is in the B range (1 – 15), I range (16 – 30), N range (31 – 45), G range (46 -60) or O range (61 – 75).  According to the range it is in, the method will check each of the cells in designated column (col 0 = B; col 1 = I; col 2 = N; col 3 = G; col 4 = O).  Example: randomNum 27 was randomly generated, which belongs to the I-range, column 1, checking rows 0 to 4.

for (int row = 0; row <= 4; row++)
{  
     //hard-code column 1 since checking I-column:
    if (randomNum == BingoCardArray[row][1])

    {
             BingoCardArray[row][1] = 0;
    }
}

etc.    //the 0 being moved to the number simulates putting a chip on the Bingo card, marking that the
          // number was called.

The gotBingo()method in the Bingo (Domain) class will return TRUE if 5 numbers were set to 0 either horizontally, vertically, or diagonally.  Otherwise, the method will return FALSE.

Each horizontal checkis a set of if-else if statements

for (int row = 0; row < 5; row++)
{
     int rowTotal = 0;

     for (int col = 0; col < 5; col++)
    {

           //add up all the column values in that row, and see if they add up to 0.

           ….

     }

}

Each vertical checkis a set of if-else if statements

for (int col = 0; col  < 5; col++)
{
     int colTotal = 0;

     for (int row = 0; row < 5; row++)
    {

           //add up all the row values in that column, and see if they add up to 0.

           ….

     }

}

//for diagonals check….
for (int row = 0; row < 5; row++)
{
     int diagonal1Total = 0;

     int diagonal2Total = 0;

     for (int col = 0; col < 5; col++)
    {

           //figure out if it is a diagonal going one way

           //figure out if it is a diagonal going the other way

           ….

     }

}

When gotBingo()ends, it will have either returned a TRUE or a FALSE.

In the driver class, the totalGamesWon is a global variable for keeping track of how many games the user wins instead of the computer. Before the

The determineWinner()method in the Bingo (Driver) class will call the gotBIngo() method in the domain class, and if it returns true, it will add 1 to the totalGamesWon, otherwise it will leave the totalGamesWon alone.

Finally, the mainmethod will contain a do-while loop that will execute at least once, and do the following:

  1. Instantiate the BingoCard class into an object
  2. Call the playGame() method in the driver class
  3. The playGame() method will call the checkBingo(int aNum) in the domain class
  4. Call the determineWinner() method in the driver class, which calls the gotBingo() method in the domain class, and add 1 to totalGamesWom whenever gotBingo() returns true.
  5. Ask user if he/she wants to repeat and play BINGO again.

In: Computer Science

Control Flow 1. What is the difference between 10 / 3 and 10 // 3? 2....

Control Flow

1. What is the difference between 10 / 3 and 10 // 3?

2. What is the result of 10 ** 3?

3. Given (x = 1), what will be the value of after we run (x += 2)?

4. How can we round a number?

5. What is the result of float(1)?

6. What is the result of bool(“False”)?

7. What is the result of 10 == “10”?

8. What is the result of “bag” > “apple”?

9. What is the result of not(True or False)?

10. Under what circumstances does the expression 18 <= age < 65 evaluate to True?

Primitive Types

1. What is a variable?

2. What are the primitive built-in types in Python?

3. When should we use “”” (tripe quotes) to define strings?

4. Assuming (name = “John Smith”), what does name[1] return?

5. What about name[-2]?

6. What about name[1:-1]?

7. How to get the length of name?

8. What are the escape sequences in Python?

9. What is the result of f“{2+2}+{10%3}”?

10. What does name.strip() do?

11. How can we check to see if name contains “John”?

12. What are the 3 types of numbers in Python?



In: Computer Science

. A study was conducted to examine the correlation between number of study hours and students...

. A study was conducted to examine the correlation between number of study hours and students grads in exam. Study hours for students: 2, 3, 5, 6, 8, 10, 10, 2, 5, 6, 5, 3, 7, 6, 2, 7, 6, 8, 2, 5 Grads in exam for students: 3, 4, 6, 7, 8, 10, 9, 8, 3, 6, 5, 4, 6, 6, 3, 7, 6, 3, 4, 5 1- as ungrouped data find the frequency, accumulated relative frequency, and accumulative relative frequency for study hours. 2- Frequency Polygon for study hours. 3- percentile graph for study hours. 4- determine whether the data for study hours are normally distributed with explanation. 5- determine whether the data for study hours are uni-modal, bimodal, or multimodal. 6- scatter and plot diagram

In: Statistics and Probability

. A study was conducted to examine the correlation between number of study hours and students...

. A study was conducted to examine the correlation between number of study hours and students grads in exam. Study hors for students: 2, 3, 5, 6, 8, 10, 10, 2, 5, 6, 5, 3, 7, 6, 2, 7, 6, 8, 2, 5 Grads in exam for students: 3, 4, 6, 7, 8, 10, 9, 8, 3, 6, 5, 4, 6, 6, 3, 7, 6, 3, 4, 5 1- as ungrouped data find the frequency, accumulated relative frequency, and accumulative relative frequency for study hours. 2- Frequency Polygon for study hours. 3- percentile graph for study hours. 4- determine whether the data for study hours are normally distributed with explanation. 5- determine whether the data for study hours are uni-modal, bimodal, or multimodal. 6- scatter and plot diagram

In: Statistics and Probability

Consider the generic ABC graphic below, for a standard two-step allocation process. ON Pool 1 ON...


Consider the generic ABC graphic below, for a standard two-step allocation process. ON Pool 1 ON Poola ON Pool 3 Adity 1 Mili
Total Assume that the costs incurred in the OH cost pools are / were $47,000 for OH Pool 1; $122,000 for OH Pool 2; and $16,0
Consider the generic ABC graphic below, for a standard two-step allocation process. ON Pool 1 ON Poola ON Pool 3 Adity 1 Mility Allvity Produd 1 Produd 2 Produd
Total Assume that the costs incurred in the OH cost pools are / were $47,000 for OH Pool 1; $122,000 for OH Pool 2; and $16,000 for OH Pool 3. Following are some activity measures that are available as possible cost drivers, with quantities for each activity noted: Activitat Activity 2 Activity 3 Activity Cost Driver 1 (D1s) 4,350 2,270 6,140 12,760 Cost Driver 2 (D2s) 870 322 1,598 Cost Driver 3 (D3s) 1,300 1,650 2,100 1,740 6,790 Cost Driver 4 (D4s) 35 55 Cost Driver 5 (D5s) 820 155 108 440 1,523 Suppose the selected cost driver is Cost Driver 4 for OH Pool 1, Cost Driver 1 for OH Pool 2, and Cost Driver 5 for OH Pool 3. Compute the POHR for each of the OH cost pools in this ABC process, and then use those POHRs to allocate all OH costs to the four activities. 406 12 8

In: Accounting

please explain how does the following C code work. a) int function1(int num1, int num2) {...

please explain how does the following C code work.

a)

int function1(int num1, int num2) {
int num = num1 ^ num2;
int result = 0;
while(num > 0) {
result += (num & 1);
num >>= 1;
}
return result;
}

b)

int function2(unsigned int num) {
return num & ~(num - 1);
}

c)

int f1(unsigned int x) {
int count = 0;
while(x) {
count++; x = x&(x-1);
}
return count;
}

d) double ldexp(double x, int exponent) is a C math function that returns x multiplied
by 2 raised to the power of exponent. How many narrowing and how many promotions
happen automatically in the following code line? Name them one by one and explain each
one separately.
float f = 2.2f * ldexp(24.4, 3.0 * 2) - 4.4;

e)

int main() {
int a[] = {1, 2, 3, 4, 5};
int *b = a; int **c = &b;
printf("%d\n", **c*2);
printf("%d\n", **c-2*4);
printf("%d\n", **c+1-*b+1);
return 0;
}

Thanks!

In: Computer Science

I dont underestand the part that i bolded in the word file . ( from where...

I dont underestand the part that i bolded in the word file . ( from where that 6/12 came ? )

Thank you ,

Pr. 21-118—Lessee accounting—capital lease.

Eubank Company, as lessee, enters into a lease agreement on July 1, 2018, for equipment. The following data are relevant to the lease agreement:

1.   The term of the noncancelable lease is 4 years, with no renewal option. Payments of $978,446 are due on July 1 of each year.

2.   The fair value of the equipment on July 1, 2018 is $3,500,000. The equipment has an economic life of 6 years with no salvage value.

3.   Eubank depreciates similar machinery it owns on the sum-of-the-years’-digits basis.

4.   The lessee pays all executory costs.

5.   Eubank’s incremental borrowing rate is 10% per year. The lessee is aware that the lessor used an implicit rate of 8% in computing the lease payments (present value factor for 4 periods at 8%, 3.57710; at 10%, 3.48685).

Instructions

(a)    Indicate the type of lease Eubank Company has entered into and what accounting treatment is applicable.

(b)    Prepare the journal entries on Eubank’s books that relate to the lease agreement for the following dates: (Round all amounts to the nearest dollar. Include a partial amortization schedule.)

        1.    July 1, 2018.

        2.    December 31, 2018.

        3.    July 1, 2019.

        4.    December 31, 2019.

Ans: NA, LO: 2, Bloom: AP, Difficulty: Difficult, Min: 20-25, AACSB: Reflective, AICPA BB: None, AICPA FN: Measurement, AICPA PC: Problem Solving, IMA: Reporting, IFRS: None

Solution 21-118

(a)    Capitalized amount:

        $978,446 × PV of an ordinary annuity for 4 periods at 8%

        $978,446 × 3.57710 = $3,500,000

        Because the present value of the lease payments ($3,500,000) equals the fair value, $3,500,000, of the leased property, it is a capital lease and must be accounted for under the capital lease method.

(b)    1.                                                            July 1, 2018

               Leased Equipment.................................................................... 3,500,000

                           Lease Liability...............................................................                        2,521,554

                           Cash.............................................................................                           978,446

         2.                                                     December 31, 2018

               Depreciation Expense..............................................................      700,000

                           Accumulated Depreciation—Capital Leases

                                [($3,500,000 × 4/10) × 6/12].....................................                           700,000

               Interest Expense ($201,724 × 6/12).........................................      100,862

                           Interest Payable............................................................                           100,862

In: Accounting

Number of units abated (reduced) MC of abatement Firm 1 MC of abatement Firm 2 MC...

Number of units abated (reduced)

MC of abatement Firm 1

MC of abatement Firm 2

MC of abatement Firm 3

1

1

2

3

2

2

4

5

3

3

12

7

4

5

14

9

5

6

16

10

6

14

22

18

  1. Now suppose that instead of a standard, the regulator has chosen to implement a pollution trading program. Specifically, 2 pollution permits are allocated to each firm and then the firms are allowed to trade, how many permits do you expect each firm to hold after trading? Why? [Each permit allows a firm to emit one unit of pollution. Assume that firms will reduce their cheapest pollution units first] What is the total cost of this policy relative to the standard? Why might the regulator want to use this policy instead of the standard? (3 points)

In: Economics

1)1. You are given the following cell at 25°C: Pb(s) | Pb2+(aq, 0.60M) || Sn2+(aq, 0.1...

1)1. You are given the following cell at 25°C: Pb(s) | Pb2+(aq, 0.60M) || Sn2+(aq, 0.1 M), Sn4+(aq, 0.15 M) |Pt(s) Write the half reactions for the cell and using Appendix D in your text book, calculate the E°cell and the Ecell

oxidation half reaction = Pb(s) ------------> Pb+2(aq) + 2e-

reduction half reaction = Sn+4(aq) + 2e- --------> Sn+2(aq)

E0cell = E0Sn+4/sn+2   E0Pb+2/Pb

E0cell = 0.15 - (-0.126)

E0cell = 0.276 V ( i'm not sure if it correct or not)

2) For the cell in #1 , compare the spontaneity of the cell as it is written to the cell under standard conditions.

3) From reading through the lab, describe the process of how you could determine if the reactions are driven by enthalpy or entropy. (Hint: how can you determine the sign of DS as you might do in this lab?)

In: Chemistry

Here are five different functional models that might represent the growth of the number of Zika...

Here are five different functional models that might represent the growth of the number of Zika cases, where x represents the week number, and y represents the number of cumulative cases.

1. Linear y = 258.74x

2. Logarithmic y=937.37ln(x)-202.03

3. Quadratic y = 31.357x ^(2 )+ 134.93x − 122

4. Power y = 55.278x ^2.0101

5. Exponential y=47.399e^(0.6737x)

For each function model listed, create a graph for 1x ≤ 5, along with the Zika case data from Step 2. Be sure your graphs clearly label the function and the actual data.

Step 2 that the question is referring to is

Below is data of the weekly number of suspected Zika cases in French Polynesia in 2013.Plot the data on the graph below.

Week #

New Cases

Cumulative Cases

1

49

49

2

191

240

3

369

609

4

331

940

5

333

1273

In: Advanced Math