Questions 2, 3, and 4 ask you to consider the situation described in the article published in Monday, March 2, 2020 issue of The Wall Street Journal and titled “Meat Stockpiles Surge as Coronavirus Epidemic Curbs Exports”. You do not have to read the story to understand the setup of these questions. Here is what you should focus on to complete your analysis.
Question 2:
Assume that prior to the outbreak of the coronavirus (Covid-19), the meatpacking industry was in Long Run Equilibrium (LRE).
In: Economics
For a particular redox reaction, ClO−2 is oxidized to ClO−4 and Fe3+ is reduced to Fe2+. Complete and balance the equation for this reaction in basic solution. Phases are optional.
Step by step please
In: Chemistry
In C# please
Exercise #4:
Create a two (2) instances of the “Dog” class in your “Main” method. One will be created using the default constructor and the other should be made using the overloaded constructor. That means that you should pass the overloaded constructor arguments that come from user input.
Print out each of the dog’s three attributes using the accessors. Then call the “UpdateBark” method for both and print out their fields again, but this time through the “ToString” method.
Example (blue is default dog’s attributes, green is the user’s dog’s):
Creating a default dog…
Finished creating a default dog!
Default dog bark sound is Yelp!
Default dog size is 20 inches.
Default dog’s cuteness is cute dog.
Continued on third page…
Please enter the sound of your dog’s bark: “MOOOOOO!”
Please enter the size of your dog: “10”
Please enter the cuteness of your dog: “ugly dog.”
Your dog bark sound is MOOOOOO!
Your dog size is 10 inches.
Your dog’s cuteness is ugly dog.
Both dogs are doing a scary bark! Their cuteness has been affected!
Default dog bark sound is Yelp!
Default dog size is 20 inches.
Default dog’s cuteness is average.
Your dog bark sound is MOOOOOO!
Your dog size is 10 inches.
Your dog’s cuteness is average.
In: Computer Science
Verify that the three eigenvectors found for the two eigenvalues of the matrix in that example are linearly independent and find the components of the vector i = ( 1 , 0 , 0 ) in the basis consisting of them. Using
\begin{vmatrix}1 & 0 & 0 \\ -4 & 7 & 2 \\ 10 & -15 & -4\end{vmatrix}
Which of these is the answer?
(2,−5,2)(2,−5,2)
(−1,3,23)(−1,3,23)
(1,−3,32)(1,−3,32)
In: Advanced Math
In main, create two FracList objects, ask the user how many elements to allocate for each list, read as many Fraction objects from the keyboard as specified by the user into each (using >> operator). Sort both lists using the sort member function and display them; and then search for a value read from the user in both lists and print the index of the first occurrence or that it could not be found in either list.
Swap the two lists entered by the user so that the smaller size list (using < or > operator which only compares their size) is the first and larger size is the second. Use a swap function to swap the two lists. The example given in module did not use a function. Remember to swap two objects, you must either pass them by reference, or pass their addresses into couple of pointers. Print both lists again to verify the swap.
Resize the larger list to a size one larger than its original size, keeping all its values and assigning to its last element the sum of all other fractions (after reducing it), and print again.
Example run of the program:
Enter size of first fraction list: 5
Enter size of second fraction list: 3
Enter 5 fractions for first list: 1/4 1/8 2/3 1/3 1/2
Enter 3 fractions for second list: 3/4 1/5 1/4
Sorted lists:
1/8 1/4 1/3 1/2 2/3
1/5 1/4 3/4
Enter a fraction to search for: 1/4
1/4 was found at index 1 of list 1.
Swapped lists:
1/5 1/4 3/4
1/8 1/4 1/3 1/2 2/3
Resized list with sum of fractions at the end:
1/8 1/4 1/3 1/2 2/3 15/8
Press any key to continue.
Use separate files for class definitions (.h), function definitions and main program (3 files).
typedef struct fraction
{
int numerator, denom;
}fraction;
int main()
{
//Array of 100 fractions
fraction arrFraction[100];
int i = 0;
int j;
int num = 1;
while (num == 1)
{
int choice;
printf("\nPress 1 to enter a fraction\n");
printf("Press 2 to view stored fractions\n");
printf("Press 3 to sort fractions\n");
scanf("%d", &choice);
if(choice == 1)
{
//Prompting user
printf("\nEnter your fraction, numerator followed by
denominator\n");
//Reading values from user
scanf("%d %d",&arrFraction[i].numerator,
&arrFraction[i].denom);
//Incrementing counter
i++;
}
if (choice == 2) {
printf("-------------------------\n");
for (j = 0; j < i; j++)
{
printf("%d %d/%d \n",
arrFraction[j].numerator/arrFraction[j].denom,
arrFraction[j].numerator%arrFraction[j].denom,
arrFraction[j].denom);
}
printf("\n-------------------------\n\n");
}
if (choice == 3)
{
int min;
fraction tmp;
for (i = 0; i < j; i++)
{
min = i;
for (j = i + 1; j < i; j++)
{
if (Calc_Frac(arrFraction[j]) <
Calc_Frac(arrFraction[min]))
{
min = j;
}
}
tmp = arrFraction[i];
arrFraction[i] = arrFraction[min];
arrFraction[min] = tmp;
}
i++;
}
}
}
return(0);
}
In: Computer Science
4). Eight maintenance activities, their normal durations in weeks, and the crew sizes for the normal condition are as follows:
|
Activity |
Duration in Weeks |
Crew size |
|
AC |
6 |
8 |
|
BC |
6 |
7 |
|
BE |
2 |
6 |
|
CD |
3 |
2 |
|
CE |
4 |
1 |
|
DF |
7 |
4 |
|
EF |
4 |
6 |
|
FG |
5 |
10 |
|
Extra Crew |
Weeks Saved |
Crash cost per week |
|
1 |
1 |
$100 |
|
2 |
2 |
$120 |
|
3 |
2 |
$200 |
|
4 |
3 |
$250 |
If there is a penalty cost of $1,250 per week beyond the minimum maintenance time of 20 weeks, recommend the minimum cost schedule.
|
Activity |
Optimistic |
Most Likely |
Pessimistic |
|
AC |
5 |
6 |
8 |
|
BC |
4 |
6 |
10 |
|
BE |
2 |
2 |
2 |
|
CD |
2 |
3 |
7 |
|
CE |
2 |
4 |
9 |
|
DF |
5 |
7 |
13 |
|
EF |
3 |
4 |
6 |
|
FG |
4 |
5 |
16 |
In: Operations Management
Please follow the instructions and solve it by C++. Thank you!
What to Submit
Submit the following:
1) Your .cpp file of the solution.
2) For what n value (approximately) does your computer stop producing output? Why is this? Enter your answer in the 'Comments' field when you submit the file.
So far in our study of recursion we identified a few common recursive number sequences, such as the Fibonacci numbers. Number sequences like this are not recursive algorithms themselves -- their definitions are ways of generating the "nth term", rather than ways of breaking down a larger problem -- but they can serve as good examples of the practical limits of recursion.
Some sequences are notoriously hard to compute (with recursion, at least) because of the deep layers required, as we will see in this week's lab.
Golomb's sequence is known as "self describing" -- it seems to define itself. It is defined as the sequence of natural numbers such that n appears exactly G(n) times in the sequence. Here are the first few values of G(n) for some n:
| n | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| G(n) | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 4 | 5 | 5 | 5 | 6 | 6 | 6 | 6 |
The sequence starts at 1, with G(1) = 1.
It's not too hard if you step through it one term at a time.
For n = 1, G(n) is 1. If you look at the sequence (the entire sequence G(n) all the way to infinity -- it seems to "know" about itself), 1 appears only 1 time.
For n = 2, G(n) is 2. Looking again at the G(n) sequence, the number 2 appears 2 times.
For n = 3, G(n) is 2. You can see that 3 appears 2 times.
For n = 4, G(n) is 3. ... and 4 appears 3 times.
And so on and so forth.
Assignment
Write a C++ program that recursively computes each term of G(n) up to and including a given n. You can "hard code" the input value (the program does not need to accept any input) but you will need to set it sufficiently high so you can determine your answer for the second part below -- you may need to experiment with different values.
The formula is:
G(n) = 1 + G(n - G(G(n - 1)))
Remember to think about the base case.
Example Output
The output of your program does not need to exactly match this, but please make sure each term is output on a separate line along with the n for that term.
For n = 15:
1: 1 2: 2 3: 2 4: 3 5: 3 6: 4 7: 4 8: 4 9: 5 10: 5 11: 5 12: 6 13: 6 14: 6 15: 6
In: Computer Science
a. By hand, make an ordered stemplot of the distribution of the variable MothersAge for the female students. Show both your rough and final version of the stemplot. Use stems of five (See the Notes for an explanation of what stems of five are). There are 63 female students.
Mother's age 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,51
Female 1, 0, 2, 2, 3, 4, 7, 3, 2, 4, 7, 1, 6, 4, 5, 3, 1, 4, 0, 1, 1, 1, 0, 1, 0
Use the stem and leaf plots that you previously created to help you draw and label histograms on your scratch paper with bin width of 2 for mothers's age at birth of female students and for mother's age at birth of male students. Make the lower bound of your first bin 16.
Comment: Bin width of 2 is not a typo. Yes, your stem and leaf plot has bins of 5 so some thinking is required, but at least your stem and leaf plot has the values in order for you.
In: Math
Calculate the ΔH for the reaction.
2 C (s) + 3 H2 (g) + 1/2 O2 (g) =
C2H5OH (l)
Given the following information:
C (s) + O2 (g) = CO2
(g)
ΔH = -393.5 KJ/mole
2 H2 (g) + O2 (g) = 2 H2O
(l)
ΔH = -571.6 KJ/mole
C2H5OH (l) + 3 O2 (g) = 2
CO2 (g) + 3 H2O (l) ΔH =
-1367.5 KJ/mole
In: Chemistry
Find the least positive solution of (a) x^2 − 29y^2 = −1 (b)x^2 − 29y^2 = 1
In: Advanced Math