Questions
1. Copy the files from Assignment 1 to Assignment 2. Relabel as necessary 2. Create 3...

1. Copy the files from Assignment 1 to Assignment 2. Relabel as necessary

2. Create 3 instances of the PetFoodCompany class - dogFoodMaker, catFoodMaker, fishFoodMaker.

3. Internally set the division name for each instance. (I.E. "Alpo" for dogFoorMaker, "Purina" for CatFoodMaker, "GloFish" for fishFoodMater)

4. Prompt me to enter the Company Name and Quarter only once.

5. For each of the above instances, prompt me for total sales and total expenses. A loop is not expected.

6. For each instance of the class, display the Company Name, Quarter. Division Name, Total Sales, Total Expenses and Net Income. The company name and quarter should be displayed for all instances.

5 Points Extra Credit: Create a method in the PetFoodCompany class that will do step 6 and call it from main() for the 3 instances.

Here is the code:

PetFoodComp.h:

class PetFoodCompany
{
public:
  
PetFoodCompany();

char getQuart();
char* getCompany();
char* getDivision();

void setQuart(char quart);
void setTotalSales(float totalSales1);
void setTotalExpences(float totalExpences1);
void setCompany(char name[]);
void setDivision(char name1[]);


float getTotalSales();
float getTotalExpences();

double netIncome();
  

private:
  
char company[40];
char division[40];

static char quart;
static double BonusRate;

float totalSales;
float totalExpences;
  
  
};

PetFood.cpp:

#include <iostream>
#include <cstring>
#include "PetFoodComp.h"

using namespace std;


double PetFoodCompany::BonusRate = 0.02;
char PetFoodCompany::quart = '1';

PetFoodCompany::PetFoodCompany()
{
   strcpy(company, "myCompanyName");
}

char PetFoodCompany::getQuart()
{
   return quart;
}

float PetFoodCompany::getTotalSales()
{
   return totalSales;
}

float PetFoodCompany::getTotalExpences()
{
   return totalExpences;
}

char* PetFoodCompany::getCompany()
{
   return company;
}

char* PetFoodCompany::getDivision()
{
   return division;
}

void PetFoodCompany::setQuart(char quart1)
{
   if (quart1 == '1' || quart1 == '2' || quart1 == '3' || quart1 == '4')
       quart = quart1;
}

void PetFoodCompany::setTotalSales(float totalSales1)
{
   totalSales = totalSales1;
}

void PetFoodCompany::setTotalExpences(float totalExpences1)
{
   totalExpences = totalExpences1;
}

void PetFoodCompany::setCompany(char name[])
{
   strcpy(company, name);
}

void PetFoodCompany::setDivision(char dname[])
{
   strcpy(division, dname);
}

double PetFoodCompany::netIncome()
{
   return (totalSales - totalExpences);
}

PetFoodMain.cpp:

#include <iostream>
#include <cstring>
#include "PetFoodComp.h"


using namespace std;

int main()
{
   double totalSales, totalExpences;
   PetFoodCompany pet;
   cout << "Company Name is " << pet.getCompany() << "\n";
   cout << "Current Quarter is " << pet.getQuart() << "\n";


   cout << "Enter Total Sales: ";
   cin >> totalSales;

   cout << "Enter Total Expences: ";
   cin >> totalExpences;

   pet.setTotalExpences(totalExpences);
   pet.setTotalSales(totalSales);

   cout << "Net Income: " << pet.netIncome() << "\n";

   return 0;
}

In: Computer Science

Let X1 and X2 be independent identically distributed random variables with pmf p(0) = 1/4, p(1)...

Let X1 and X2 be independent identically distributed random variables with pmf p(0) = 1/4, p(1) = 1/2, p(2) = 1/4

(a) What is the probability mass function (pmf) of X1 + X2?

(b) What is the probability mass function (pmf) of X(2) = max{X1, X2}?

(c) What is the MGF of X1?

(d) What is the MGF of X1 + X2

In: Statistics and Probability

For decades, researchers have studied the relationship between violent media and violent behavior, with some studies...

For decades, researchers have studied the relationship between violent media and violent behavior, with some studies finding a relationship, and others not. The following are data from a small study of teenagers that investigates the relationship between playing violent video games and fighting at school.

Case

Hours spent playing violent video games per week

Number of fights during school year

1

0

0

2

20

3

3

30

4

4

5

1

5

2

0

6

0

0

7

10

1

8

5

0

9

5

1

10

8

1

11

10

2

12

2

0

13

2

1

14

40

5

15

11

1

16

6

1

17

3

0

18

4

1

19

5

2

20

1

0

Use the above data to construct a scatterplot. Additionally, interpret the scatterplot.

In: Statistics and Probability

Suppose that someone claims that the average number of siblings per person is 2. Use our...

Suppose that someone claims that the average number of siblings per person is 2. Use our survey data to test this claim. Use the p-value method. Assume 0.05 for the level of significance. Construct an appropriate confidence interval to see if the two methods produce the same conclusion.

1) Write the claim mathematically and identify H0andHa

2) Determine whether the hypothesis test is a one-tailed or a two-tailed test and whether to use a z-test, a t-test or a chi-square test. Explain your reasoning.

3) Find the test statistic and the p-value

4) Decide whether to reject or fail to reject the null hypothesis.

5) Construct the appropriate confidence interval

6) Interpret the decision in the context of the original claim.

Student Number of Siblings
1 6
2 3
3 2
4 2
5 1
6 1
7 1
8 1
9 1
10 4
11 6
12 1
13 7
14 2
15 1
16 0
17 2
18 2
19 6
20 1
21 1
22 2
23 2
24 2
25 2
26 2
27 2
28 1
29 1
30 1
31 3
32 3
33 2
34 1
35 5
36 3
37 2
38 5
39 1
40 0
41 0
42 1
43 1
44 1

NEED ANSWER ASAP! THANK YOU

In: Statistics and Probability

Use the provided excel format to formulate an answer The Salem Board of Education wants to...

Use the provided excel format to formulate an answer

The Salem Board of Education wants to evaluate the efficiency of the town’s four elementary schools. The three outputs of the schools are

■   output 1 = average reading score
■   output 2 = average mathematics score

■   output 3 = average self-esteem score


The three inputs to the schools are

■   input 1 = average educational level of mothers
(defined by highest grade completed: 12 = high
school graduate; 16 = college graduate, and so on)

■   input 2 = number of parent visits to school (per child)

■   input 3 = teacher-to-student ratio

The relevant information for the four schools is given in the file P04_42.xlsx. Determine which (if any) schools are inefficient.

Selected DEA school
Inputs used for outputs produced
Inputs
School Input 1 Input 2 Input 3
1 13 4 0.05
2 14 5 0.05
3 11 6 0.06
4 15 8 0.08
Outputs
School Output 1 Output 2 Output 3
1 9 7 6
2 10 8 7
3 11 7 8
4 9 9 9
Input 1 Input 2 Input 3
Unit costs of inputs
Output 1 Output 2 Output 3
Unit value of outputs
Costs/prices of inputs/outputs used
School Input costs Output values
1
2
3
4
Selected school input cost
Selected school output value
School Efficient or not?
1
2
3
4

Use the provided excel format to explain answer

In: Statistics and Probability

Directions: Identify 3-4 expected assessment findings and 3-4 abnormal assessment findings for each of the physical assessment categories.

Directions: Identify 3-4 expected assessment findings and 3-4 abnormal assessment findings for each of the physical assessment categories.

System                              Expected finding                           Abnormal                         Geriatric Finding

Nails                                  1.                                                      1.                                       1.

                                           2.                                                      2.

                                           3.                                                      3.

                                           Expected finding newborn/infant)         

                                           1.                                                                    

                                                                                                                  

                                           Expected finding (children/adolescents)             

In: Nursing

Determine the mode of the frequency distribution given below?

Determine the mode of the frequency distribution given below?

x:  1,   2,   3,   4

f:   2,  3,  10,  4

In: Statistics and Probability

In testing a new drug, we obtained the following results: Placebo Drug A Drug B Drug...

In testing a new drug, we obtained the following results:

Placebo Drug A Drug B Drug C
5 4 6 7
2 3 3 6
4 1 4 5
2 1 3 4
2 1 4 3

Run the ANOVA and fill in the summary table with the results obtained:

SS df MS F-ratio p-value
Between 3
Within 16
TOTAL 19

(Report P-value & F-ratio accurate to 3 decimal places and all other values accurate to 2 decimal places.)

What conclusion can be drawn at the 0.01 significance level?

  • ___The various drugs do not have results that are statistically different.
  • ___The various drugs have results that are statistically different.

In: Statistics and Probability

A network consists of the following list. Times are given in weeks. Activity Preceding Optimistic Probable...

A network consists of the following list. Times are given in weeks.

Activity

Preceding

Optimistic

Probable

Pessimistic

A

--

6

8

10

B

A

1

2

4

C

A

9

12

15

D

A

3

4

5

E

B

4

6

7

F

B

14

16

22

G

C, D

2

3

4

H

E, G

1

2

3

I

G

6

8

9

J

H, I

4

6

8

K

F, H, J

1

2

5

a. Draw the network diagram.

b. Calculate the expected duration and variance of each activity.

c. Calculate the expected duration and variance of the critical path

d. Calculate the probability that the project will be completed in less than 42 weeks.

In: Finance

Use a Karnaugh map to find the minimum AND-OR expression for x(a, b, c) with don’t-care...

Use a Karnaugh map to find the minimum AND-OR expression for x(a, b, c) with don’t-care conditions:

(c) Σ(1, 3) + d(0, 2, 4, 6)

(e) Σ(1, 7) + d(2, 4)

In: Computer Science