In: Statistics and Probability
C++ Program - Arrays-
Include the following
header files in your program: string,
iomanip, iostream
Suggestion: code steps 1 thru 4 then test then add
requirement 5, then test, then add 6, then test etc.
Add comments to display assignment //step 1., //step 2. etc. This program is to have no programmer created functions. Just do everything in main and make sure you comment each step so I can grade more easily. Also, this program will be expanded in Chapter 9 to use pointers.
Create a program which
has:
1. The following arrays created:
a. an array of double with 5 elements, dArr
b. an array of long, lArr, with 7 elements and
initialized at the time of creation with the values
100000, 134567, 123456, 9, -234567, -1, 123489
c. a 2 dimensional array of integer, with 3 rows and 5
columns, iArr.
d. an array of char with your name initialized in it. Big enough
for 30 typable characters, sName.
2. define 3 variables, , cnt1 and
cnt2 (short data types) as general purpose
counters and a long double total
3. define 1 long variable called highest
4. a for loop to put a random number into each of
the elements of the array of double, dArr. Use rand() and seed a
random starting point with srand(). Use a for loop to display all
of the values in dArr.
5. another for loop to add up the array of double,
dArr, into the variable
total
6. one cout to print the total and another cout to
print the average of the double array,
dArr.
7. a for loop similar to the following for the long array,
lArr:
for ( cnt1 = 1, highest = lArr[0] ; cnt1 < 7 ; cnt1++ )
{
//logic to compare each array element, starting with lArr[1], with
highest
//replace highest if the value in lArr[cnt] is higher than the
value in variable highest
}
8. a cout to print
highest as derived in the above
code
9. a for loop to put a random number, each with a value no lower
than 1 and no higher than 53, into each element of
iArr, the array of integer, seed the random
generator with srand( (unsigned) time(NULL)). Only have to run
srand once…. Use the modulo operator similar to the way you did
with dice rolls in Project 2.
10. a separate loop to print iArr with 3 rows on
your screen. Each row has 5 numbers. Use setw to control the width
of each column. See Chapter 3 for an example of a program using
setw. Print row by row.
11. a loop to print the 2 dimensional array, iArr,
so that all 3 numbers in column 0 are printed and then on the next
line all 3 numbers in column 1, etc. thru column 4. Print column by
column.
12. Use cin.getline( ...... ) to type another name into the
variable sName.
13. Print the ascii value of each character in the char array, 1
per line. Use a while loop and look for the '\0'
as a signal to end.
14. make the array of char, sName, have the name
"Albert Einstein" in it. You must use strcpy_s function.
15. print the ascii value of the 12th character of the string
sName
In: Computer Science
Calculate PART A PART B PART C:
PART A:
A national poll was conducted to determine the proportion of people that prefer a Congressional candidate by the name of Jeff. After completing the poll, a 99% confidence interval was calculated to show the proportion of the population that preferred Jeff. The confidence interval was:
0.469 < p < 0.577
Can we be reasonably sure that Jeff will have at least 50% of the vote?
Why or why not?
PART B:
The Math 122 Midterm Exam is coming up. Suppose the exam scores are normally distributed with a population mean of 77.7% and a standard deviation of 17.8%.
Let's first create a simulation to observe the expected results for a class of Math 122 students. In Excel, create 25 random samples of 22 students each. This means you should have 22 entries in each column, and you should be using columns A - Y. If you need a refresher for creating a random sample that is normally distributed, you can review the Technology Corner from Module 2.
After creating your random samples, copy all the numbers then use the "Paste Values" option in Excel to lock the numbers in place. Save your file, then attach it here:
Now find the mean of each sample.
What is the highest mean?
What is the lowest mean?
Note: While there are no points associated with the attachment or the highest/lowest mean, points will be deducted for not completing this portion or doing it incorrectly. These should be used to help you understand the remainder of the problem.
What is the probability of a student getting a score of 90% or better? (Round to four decimal places.)
What is the probability of a class of 22 students having a mean of 90% or better? (Round to six decimal places.)
Explain, in your own words, why the answers to these two questions are drastically different. Your explanation should include:
In: Statistics and Probability
Steven's Battery Company has two service departments, Maintenance and Personnel. Maintenance Department costs of $320,000 are allocated on the basis of budgeted maintenance-hours. Personnel Department costs of $80,000 are allocated based on the number of employees. The costs of operating departments A and B are $160,000 and $240,000, respectively. Data on budgeted maintenance-hours and number of employees are as follows:
| Support Departments | Production Department | |||
| Maint Department | Personnel Department | A | B | |
| Budgeted Costs | $320,000 | $80,000 | $160,000 | $240,000 |
| Budgeted Maintenance hours | NA | 800 | 960 | 640 |
| Number of employees | 40 | NA | 160 | 480 |
Required
1-Allocate the costs of the service departments to the production departments using the direct method
2-Allocate the costs of the service departments to the production departments using the step-down method, if the service department with the highest percentage of interdepartmental support service is allocated first. (Round up)
In: Accounting
1. The Australian Maritime Safety Authority has found that 10%
of ships have navigation faults (N) and 20% have other safety
faults (F), such as non–compliance with regulations for fire
extinguishers. Six percent of ships have both faults. A ship is
selected at random.
(a) Show the sample space and the events N and F as a Venn
diagram.
(b) What is the probability the ship has either N or F?
(c) What is the probability the ship has neither N nor F?
(d) What is the probability the ship has N given that it has F? (e) What is the probability the ship has F given that it has N?
2. An email filter sends some incoming messages to Trash.
However, it is not reliable. If a message is not trash it gets sent
to Trash with a probability of 0.04. If a message is trash it is
not sent to Trash with a probability of 0.10. Suppose 30% of
incoming messages are trash.
(a) Draw a tree diagram to show the sample space.
(b) What proportion of incoming messages get sent to Trash?
(c) What is the probability that a message is trash given that it was sent to Trash?
3. A crushed drill core sample contains 20 gold nuggets. Assume
the nuggets are randomly and independently distributed within the
sample. A one– fifth part of the sample will be taken for further
assay.
(a) What is the expected number of nuggets in the one–fifth
part?
(b) Consider a binomial distribution model for the number of nuggets in the one–fifth part of the sample and give values for n and p.
(c) What is the probability of 2 nuggets in the one–fifth part?
(d) What is the probability of 2 or fewer nuggets in the one–fifth part?
4. The number of loss of separation incidents (LOS) in the
airspace around a busy airport has averaged 8.7 per year. New radar
was installed six months ago, since when there have been 8 LOS.
Assume LOS occur randomly and independently. Suppose that the
average annual rate of 8.7 LOS per year has not changed.
(a) What is the average rate of LOS per six months?
(b) Calculate the probability of 8 LOS in six months.
(c) Calculate the probability of 8 or more LOS in six months.
(d) It has been suggested that the new radar has led to an increase in LOS. Which of the two probabilities, (b) or (c), is the more relevant when considering this claim?
In: Statistics and Probability
1. Statista reported in 2014 that the mean number of Facebook
friends for 18 to 24 year olds was 649. Assuming the distribution
is normal with mean 649 friends and standard deviation 80 friends,
what is the probability that a randomly selected 18 to 24 year old
will have between 565 and 822 friends?
P(565 < X < 822) =
Enter your answer as a number accurate to 4 decimal places. *Note:
all z-scores must be rounded to the nearest hundredth.
2. Suppose that a brand of lightbulb lasts on average 1958 hours
with a standard deviation of 100 hours. Assume the life of the
lightbulb is normally distributed. Calculate the probability that a
particular bulb will last from 1940 to 2196 hours?
P(1940 < X < 2196) =
Enter your answer as a number accurate to 4 decimal places.
*Note: all z-scores must be rounded to the nearest hundredth.
3. Suppose a drive for a PGA Tour golfer is 319.9 yards with a
standard deviation of 32.7 yards. Find the probability that a
random drive will travel more than 266.3 yards.
P(X > 266.3) =
Enter your answer as a number accurate to 4 decimal places. *Note:
all z-scores must be rounded to the nearest hundredth.
In: Statistics and Probability
An instructor who taught two sections of engineering statistics last term, the first with 25 students and the second with 35, decided to assign a term project. After all projects had been turned in, the instructor randomly ordered them before grading. Consider the first 15 graded projects.
(a) What is the probability that exactly 10 of these are from
the second section? (Round your answer to four decimal
places.)
(b) What is the probability that at least 10 of these are from the
second section? (Round your answer to four decimal places.)
(c) What is the probability that at least 10 of these are from the
same section? (Round your answer to four decimal places.)
(d) What are the mean value and standard deviation of the number
among these 15 that are from the second section? (Round your mean
to the nearest whole number and your standard deviation to three
decimal places.)
| mean | projects |
| standard deviation | projects |
(e) What are the mean value and standard deviation of the number of
projects not among these first 15 that are from the second section?
(Round your mean to the nearest whole number and your standard
deviation to three decimal places.)
| mean | projects |
| standard deviation | projects |
In: Statistics and Probability
|
The Downtown Parking Authority of Tampa, Florida, reported the following information for a sample of 232 customers on the number of hours cars are parked and the amount they are charged. |
| Number of Hours | Frequency | Amount Charged | ||||
| 1 | 20 | $ | 3 | |||
| 2 | 37 | 7 | ||||
| 3 | 49 | 10 | ||||
| 4 | 39 | 17 | ||||
| 5 | 33 | 21 | ||||
| 6 | 17 | 25 | ||||
| 7 | 3 | 27 | ||||
| 8 | 34 | 31 | ||||
| 232 | ||||||
| a. |
Convert the information on the number of hours parked to a probability distribution. (Round your answers to 3 decimal places.) |
| Hours | Probability |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| a-2. | Is this a discrete or a continuous probability distribution? |
|
| b-1. |
Find the mean and the standard deviation of the number of hours parked. (Do not round intermediate calculations. Round your final answers to 3 decimal places.) |
| Mean | |
| Standard deviation | |
| b-2. |
How long is a typical customer parked? (Do not round intermediate calculations. Round your final answers to 3 decimal places.) |
| The typical customer is parked for | hours |
| c. |
Find the mean and the standard deviation of the amount charged. (Do not round intermediate calculations. Round your final answers to 3 decimal places.) |
| Mean | |
| Standard deviation | |
In: Statistics and Probability
A department store manager has monitored the number of complaints received per week about poor service. The probabilities for numbers of complaints in a week, established by this review, are shown in the table.
| Number of complaints | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Probability | 0.10 | 0.29 | 0.33 | 0.13 | 0.07 | 0.08 |
What is the probability of between 2 and 3 (inclusive) complaints received per week?
Please specify your answer in decimal terms and round your answer to the nearest hundredth (e.g., enter 12 percent as 0.12).
Note that the correct answer will be evaluated based on the full-precision result you would obtain using Excel.
A department store manager has monitored the number of complaints received per week about poor service. The probabilities for numbers of complaints in a week, established by this review, are shown in the table.
| Number of complaints | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Probability | 0.17 | 0.30 | 0.33 | 0.07 | 0.05 | 0.08 |
What is the mean of complaints received per week?
Please round your answer to the nearest hundredth.
Note that the correct answer will be evaluated based on the full-precision result you would obtain using Excel.
In: Statistics and Probability
The parking authority in downtown Halifax reported the following information for a sample of 260 customers on the number of hours cars are parked and the amount they are charged:
| Number of Hours | Frequency | Amount Charged |
| 1 | 15 | $2 |
| 2 | 44 | 4 |
| 3 | 63 | 6 |
| 4 | 49 | 8 |
| 5 | 38 | 10 |
| 6 | 13 | 14 |
| 7 | 7 | 18 |
| 8 | 31 | 20 |
| Total | 260 | |
a-1. Convert the information on the number of hours parked to a probability distribution. (Round the final answers to 3 decimal places.)
| Hours | Probability |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
a-2. Is this a discrete or a continuous probability distribution?
(Click to select) Discrete Continuous
b-1. Find the mean and the standard deviation of the number of hours parked. (Round the final answers to 3 decimal places.)
Mean
Standard deviation
b-2. How would you answer the question, how long is a typical customer parked? (Round the final answer to 3 decimal places.)
The typical customer is parked for hours.
c. Find the mean and standard deviation of the amount charged. (Round the final answers to 2 decimal places.)
Mean
Standard deviation
In: Statistics and Probability