5. Given the following declarations and assignments, what do these expressions evaluate to?
int a1[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
int *p1, *p2;
p1 = a1+3;
p2 = &a1[2];
(a) *(a1+4) (b) a1[3] (c) *p1 (d) *(p1+5) (e) p1[-2]
(f) *(a1+2) (g) a1[6] (h) *p2 (i) *(p2+3) (j) p2[-1]
In: Electrical Engineering
(C++)
Write a program that prints a table in the following format given a "x" read from the keyboard. For example, if x is 4, it prints out
0 0
1 1
2 4
3 9
4 16
To avoid mismatch, put 8 white spaces between two numbers.
In: Computer Science
1. Of 12 possible books, you plan to take 4 with you on vacation. How many different collections of 4 books can you take?
2. There are 14 standbys who hope to get seats on a flight, but only 6 seats are available on the plane. How many different ways can the 6 people be selected?
3. A die is rolled. The set of equally likely outcomes is {1, 2, 3, 4, 5, 6}. Find the probability of rolling a number greater than 4.
4. A die is rolled. The set of equally likely outcomes is {1, 2, 3, 4, 5, 6}. Find the probability of rolling a number less than 20.
5. A city council consists of six Democrats and four Republicans. If a committee of three people is selected, find the probability of selecting one Democrat and two Republicans.
6. A parent-teacher committee consisting of four people is to be selected from fifteen parents and five teachers. Find the probability of selecting two parents and two teachers.
In: Statistics and Probability
In: Finance
Problem 1 (In order to get credit, show your work and you can
copy the tables below into the answer box to fill in.)
Sugar Land Company is considering adding a new line to its product
mix, and the capital budgeting analysis is being conducted by a MBA
student. The production line would be set up in unused space in
Sugar Land’ main plant. Total cost of the machine is $260,000. The
machinery has an economic life of 4 years, and MACRS will be used
for depreciation. The machine will have a salvage value of 40,000
after 4 years.
The new line will generate Sales of 1,350 units per year for 4
years and the variable cost per unit is $100 in the first year.
Each unit can be sold for $200 in the first year. The sales price
and variable cost are expected to increase by 3% per year due to
inflation. Further, to handle the new line, the firm’s net working
capital would have to increase by $30,000 at time zero (The NWC
will be recouped in year 4). The firm’s tax rate is 40% and its
weighted average cost of capital is 10%.
|
Year 1 |
Year 2 |
Year 3 |
Year 4 |
|
|
Depreciation |
|
Year 1 |
Year 2 |
Year 3 |
Year 4 |
|
|
$ Sales |
||||
|
$ Variable costs |
|
Year 1 |
Year 2 |
Year 3 |
Year 4 |
|
|
Sales |
||||
|
OCF |
|
Year 0 |
Year 1 |
Year 2 |
Year 3 |
Year 4 |
|
|
CF of the project |
|
NPV = |
|
|
IRR = |
|
|
MIRR = |
|
|
PI |
In: Economics
A natural cubic spline S is defined by S(x) = { S0(x) = a0 + b0(x − 1) + d0(x − 1)3 , if 1 ≤ x ≤ 2, S1(x) = a1 + b1(x − 2) − 3 4 (x − 2)2 + d1(x − 2)3 , if 2 ≤ x ≤ 3. Use S to interpolate data f(1) = 1, f(2) = 1, f(3) = 0, find a0, b0, d0, a1, b1, and d1.
In: Advanced Math
A series of numerical values have been obtained from a temperature sensor operating in a refrigeration unit. You have been tasked to use the C programming language to develop a program which will query the data series to compute a statistical summary. Upload your C source file to answer the question. The following conditions apply:
Your program will read data via the standard input stream, and generate a report to the standard output stream.
The data will be supplied in a plain text file.
Numeric values are represented as decimal-format integers, separated by white space.
Values of interest occupy the range {-10,…,30}.
Due to sampling errors, the series also contains outliers – integers which fall outside the range of interest.
Your program must parse the input file and count the number of occurrences of each value in the range of interest, ignoring any value outside that range.
The lowest occurrence count, and all values for which the occurrence count is equal to the lowest count.
The second-lowest occurrence count, and all values for which the occurrence count is equal to the second-lowest count.
A complete listing showing the number of occurrences of each value in the range of interest.
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define MAX_VAL 30
#define MIN_VAL -10
// Declare and initialise any additional global variables here, as
required.
void process(int x) {
// Process one value here.
}
void post_process() {
// Compute derived results here.
}
void print() {
// Print results here
}
int main(void) {
int x;
while (1 == scanf("%d", &x)) {
process(x);
}
post_process();
print();
return 0;
}
-6 23 29 15 32 39 -13 12 24 -7 33 32 40 22 35 -2 20 25 27 36 -18 27 -7 35 -11 25 -16 24 8 10 31 10 18 3 31 2 4 -2 40 -18 18 -1 -8 33 21 -19 -8 21 14 -14 23 32 -8 12 -18 30 -2 -4 37 29 -18 37 8 24 32 10 32 -12 6 14 28 30 13 -13 30 -11 22 20 32 22 16 36 29 -8 13 -19 13 -6 -8 37 1 -10 -14 -14 34 -9 -1 21 -13 5 -8 24 -4 31 3 15 38 -8 -13 11 5 21 25 -13 6 22 40 -11 13 -16 30 -18 -12 28 11 -6 10 12 -10 -14 40 20 -2 -5 -16 -17 4 -12 10 24 -12 27 15 1 37 1 6 -2 14 20
cat sample.txt | ./example
your program will ideally produce this output:
The lowest count is 0, at -3, 0, 7, 9, 17, 19, 26
The second-lowest count is 1, at -9, -5, 2, 16
The complete histogram is:
-10 -> 2
-9 -> 1
-8 -> 7
-7 -> 2
-6 -> 3
-5 -> 1
-4 -> 2
-3 -> 0
-2 -> 5
-1 -> 2
0 -> 0
1 -> 3
2 -> 1
3 -> 2
4 -> 2
5 -> 2
6 -> 3
7 -> 0
8 -> 2
9 -> 0
10 -> 5
11 -> 2
12 -> 3
13 -> 4
14 -> 3
15 -> 3
16 -> 1
17 -> 0
18 -> 2
19 -> 0
20 -> 4
21 -> 4
22 -> 4
23 -> 2
24 -> 5
25 -> 3
26 -> 0
27 -> 3
28 -> 2
29 -> 3
30 -> 4
In: Computer Science
1. Suppose you are studying for the final exam. You have only one last hour to study either accounting, economics, or statistics. The marginal point per hour are 5, 3, and 4, respectively. Which subject should you study? (Assuming that you would pass all classes regardless of what you choose to study.)
Accounting.
Economics.
Statistics.
It does not matter. You would study either one of them.
2.
| Unit of Apples | MU of Apple | Unit of Oranges | MU of Oranges |
| 1st | 4 | 1st | 9 |
| 2nd | 3 | 2nd | 3 |
| 3rd | 1 | 3rd | 2 |
| 4th | 0 | 4th | 0 |
Suppose the price of an apple is $2 and the price of an orange is $3. With your budget $10, how many apples and oranges would you buy?
|
3 apples and 1 orange. |
||
|
3 oranges and no apple. |
||
|
2 apples and 2 oranges. |
||
|
3 oranges and 1 apple. |
3.
Suppose the price of an apple is $2, and the price of an orange if $3. You have a budget $10 for these two items. What would you put in your basket first?
4.
|
|||||||||||||||||||||||||||||||||
In: Economics
Measurement, external, internal and statistical conclusion validity are the four major types of validity. What does each address, and give an example (1 or 2 sentences) of an experiment that addresses each type of validity? What are the 4 components of external validity, what does each address, and give an example (1 or 2 sentences) of an experiment that addresses each component of external validity? What are the 4 stages of participant selection/sampling and what does each address? What is the difference between a qualitative variable and a quantitative variable and give 4 examples of each? What is the difference between an independent variable and a dependent variable? Give me a simple 1 or 2 sentence study outlining the independent and dependent variables (hint: think cause and effect). 2 pts. If we were going to run an experiment that measures if rise in temperature in a classroom is related to aggression and degree of liking people, how would you operationally define the variables (hint: there are 3 – 2 dependent variables and 1 independent variable)? 2 pts.
In: Psychology
Please solve the recurrence relation by finding the explicit formula of each problem. Show all work, thanks!
A. ck = 6ck-1 - 9ck-2 k≥2, c0 =1, c1=3
B. dk = 2dk-1 +k k≥1, d0 =1, d1=3
C. ak = 3ak-1 + 2 k≥1, a0 =3
D. bk = -bk-1 + 7bk-2 k≥2, b0 =1, b1=4
In: Advanced Math