3.32 Prog4-Branches-Listing names A university has a web page that displays the instructors for a course, using the following algorithm: If only one instructor exists, the instructor's first initial and last name are listed. If two instructors exist, only their last names are listed, separated by /. If three exist, only the first two are listed, with "/ …" following the second. If none exist, print "TBD". Given six words representing three first and last names (each name a single word; latter names may be "none none"), output one line of text listing the instructors' names using the algorithm. If the input is "Ann Jones none none none none", the output is "A. Jones". If the input is "Ann Jones Mike Smith Lee Nguyen" then the output is "Jones / Smith / …". Hints: Use an if-else statement with four branches. The first detects the situation of no instructors. The second one instructor. Etc. Detect whether an instructor exists by checking if the first name is "none".
In: Computer Science
Discounted Cash Flow Valuation
You and your spouse begin immediately saving for retirement and the dreamy “ever after” that you need to fund. At this point, your “ever after” fund has a balance of $0. You begin depositing $300 each month, starting one month from now, for the next 30 years. Your spouse begins depositing $5,000 each year, starting one year from now, into the same account for the next 30 years. The joint account earns 9 percent APR, compounded monthly. How much will you two have in your joint account 30 years from now, immediately after your last deposits?
Part B Your “ever after” is expected to be funded by monthly withdrawals, starting one month after your last deposits, and it is expected to last for 35 years. How much will you two (collectively) have to happily spend each month, assuming your accounts continue to earn the same rate as before?
In: Finance
A survey was conducted to determine whether hours of sleep per night are independent of age. A sample of individuals was asked to indicate the number of hours of sleep per night with categorical options: fewer than 6 hours, 6 to 6.9 hours, 7 to 7.9 hours, and 8 hours or more. Later in the survey, the individuals were asked to indicate their age with categorical options: age 39 or younger and age 40 or older. Sample data follow.
| Hours of Sleep | Age Group | |
|---|---|---|
| 39 or younger | 40 or older | |
| Fewer than 6 | 40 | 38 |
| 6 to 6.9 | 60 | 57 |
| 7 to 7.9 | 75 | 73 |
| 8 or more | 65 | 92 |
Find the value of the test statistic. (Round your answer to three decimal places.)____
What is the p-value? (Round your answer to four decimal places.)
p-value = ____
What is your estimate of the percentages of individuals who sleep fewer than 6 hours, 6 to 6.9 hours, 7 to 7.9 hours, and 8 hours or more per night?
Fewer than 6__%
6 to 6.9__%
7 to 7.9__%
8 or more__%
In: Statistics and Probability
A symmetric password is used to encrypt an insurance policy PDF.
You discover that the password is
always 7 characters long. The first two digits is the state
abbreviation (e.g. New Jersey is NJ) and the
last 5 digits is the zip code where the insurance policy is
created. Using brute force, how many possible
combinations are there?
In: Computer Science
OC Music Company has been in business for 4 years. Data about the sales of each quarter were collected below. The manager wants use these data to forecast sales of the 5th year. Please copy and paste it to Excel and run regression analysis. Answer the following 4 questions.
|
Year |
Quarter |
Sales |
|
1 |
Q1 |
7 |
|
Q2 |
2 |
|
|
Q3 |
4 |
|
|
Q4 |
10 |
|
|
2 |
Q1 |
6 |
|
Q2 |
3 |
|
|
Q3 |
8 |
|
|
Q4 |
14 |
|
|
3 |
Q1 |
10 |
|
Q2 |
3 |
|
|
Q3 |
5 |
|
|
Q4 |
16 |
|
|
4 |
Q1 |
12 |
|
Q2 |
4 |
|
|
Q3 |
7 |
|
|
Q4 |
22 |
Question 16
Develop a model for trend and seasonality. Please clearly define your variables. How many independent variables do you have in your regression?
Question 17
What is the intercept in your estimated regression model? Rounded to two decimal places.
Question 18
Use the model to forecast for sales of last quarter in the 5th year. Rounded to two decimal places.
Question 19
Calculate the MAE for this time series forecast.
I need to see entire Excel file and how you set up the Intercepts.
In: Statistics and Probability
8.
Suppose X~N(100,15), what is Pr(100<X<130)
9.
Suppose X~N(100,15), what is Pr(100<X<130)
10.
Suppose X~N(100,15), what is Pr(X<120)
11.
Suppose X~N(100,15), what is Pr(85<X<130)
12.
Suppose X~N(150,25), what is Pr(140<X<165)
In: Statistics and Probability
Finite Math
The Green Company manufactures an electric motorcycle, which it sells through two of its company-owned retail stores. Store A has requested between 40 and 50 motorcycles, inclusive, and Store B has requested between 30 and 40 motorcycles, inclusive. On the basis of previous sales, the Green Company has decided that the number of motorcycles shipped to Store B should equal or exceed 40% of the number shipped to Store A by 20 motorcycles. The shipping costs from the manufacturer to Store A and Store B respectively are $40 and $60 per motorcycle. How many motorcycles should the Green Company ship to each store in order to minimize its shipping costs? What is the minimum cost?
In: Advanced Math
Here we will be taking data in as a file instead of from the command line (no cin). Note that the sample file provided here is not the file that I will use to grade your assignment but the formatting will be the same.
File input is very similar to how data comes in from the user through cin (using the same operators) but we will need to setup the stream ourselves.
First we need to include <fstream> at the top of our file.
We will need to create an input file stream to work from now. We will do this with ifstream. ifstream is a datatype just like int or float. Create a variable with the datatype being ifstream. We will define the variable by using the member accessor operator to call the open function and passing in “Person.txt”, which is where our data will be.
Example: [whatever the variable name is].open(“Person.txt”);
Your program must be setup to open “Person.txt” as the file. For testing you can add your own Person.txt file into visual studios as a resource.
The file your program will have to take in will be formatted like so:
The first 2 numbers are the min and max that the Person can work. Anything under the min and the employee is docked salary. Anything above and the employee must be paid overtime. These number may vary but min will always be less than the max.
There will then be 5 lines with different amounts of numbers (indicating the Person’s work times per line):
The first number will tell how many numbers will follow (since some weeks do not have 5 work days and can have holidays.
Example file 1:
35 45
5 8 8 7 9 8
4 10 8 2 13
6 4 8 10 9 8 1
5 8 10 10 10 10
3 8 7 8
Example file 2:
20 20
3 8 8 4
2 8 8
3 8 8 8
5 8 8 4 4 2
2 4 5
You will read the first number in using the stream extraction operator. Based on that number you can read in the rest of the numbers (again using the stream extraction operator). What you will be trying to identify is whether the Person whose data you read in worked more than their max hours per week - in which case you will indicate this by outputting “OVERTIME” and however much over the max the person worked for that week. Or if the Person worked less than their min you should output “DOCK” and indicate how many hours below min they worked.
The work week will always begin on a 5 day schedule, though some persons may work on the weekend (as much as 7 days). If the person only worked 4 days or less then they will still be held to the same min and max hours. Unless you are on the last week, which may not have 5 full days in it. For the last week you must prorate (get a percentage) according to how many days are indicated. Meaning if there is only 4 days in the last week and the employee normally will work 40 hours per their min then they would only have to work 32 (40 * 4/5 = 32) hours on the last week.
The final output should indicate per week whether they should be “Docked pay”, “Normal pay”, or “Overtime” for each week (Dock and Overtime of course indicating by how much). So the output of the sample above could be:
Example Output 1:
NORMAL
DOCK 2
NORMAL
OVERTIME 3
NORMAL
Example Output 2:
NORMAL
DOCK 4
OVERTIME 4
OVERTIME 6
OVERTIME 1
Final submission should be your .cpp file only
In: Computer Science
7. The simplest possible experimental design
a. has one condition
b. has two conditions
c. uses random assignment
d. is a multi-level experiment
8. In a ________ design, participants are randomly assigned to one of two or more groups.
a. pretest-posttest
b. repeated measures
c. matched-participants
d. randomized groups
9. Which of the following is an advantage of matched-subjects designs over randomized groups designs? a. fewer participants are needed
b. the experimental groups are more likely to be similar
c. they are easier to conduct
d. pretest sensitization is less likely
10. Which of the following is an advantage of repeated measures over randomized groups designs?
a. order effects are possible
b. the experimental groups are likely to be more random
c. fewer participants are needed
d. fewer experimental conditions are used
In: Psychology
5. Why is it necessary to assume that the data are distributed normally when calculating a z score?
6. Why do descriptive statistics differ for variables with different levels of measurement?
7. A researcher collects data on the ages of individuals in two separate samples of equal size and concludes that one sample’s distribution is extremely platykurtic and the other sample’s distribution is extremely leptokurtic. What conclusion (if any) can the researcher make about comparisons of the frequency of cases in the modal categories in the two samples? Why?
8. If the z score corresponding to the length of one inmate’s prison sentence is 1.8 and the z score corresponding to the length of another inmate’s prison sentence is 2.5, what could you say about the severity of the first inmate’s sentence relative to the second inmate’s sentence?
9. What is obtained when we calculate a confidence interval?
In: Statistics and Probability