Questions
Write a decision-making program with command-line interface to implement a housing-score calculator (inspired by the 2020...

Write a decision-making program with command-line interface to implement a housing-score calculator (inspired by the 2020 Nifty Decision Makers by Evan Peck)

Your program will consist of two functions:

  • main()
    • Asks the user 5 questions and stores the answers: year (int), age (int), probation (string), full-time (int), gpa (float) (see sample run below)
    • Calls computeScore(answers), where answers is a list containing the variables in which the answers are stored in the order in which they are received (python lists may contain variables of different type)
    • Prints the value returned by computeScore
  • computeScore(answers)
    • Computes the housing score based on the values in answers as follows:
      • Current Freshman: 1 point
      • Current Sophomore: 2 points
      • Current Junior: 3 points
      • Current Senior: 4 points
      • 23+ Years of Age: 1 point
      • Full-Time: 1 point
      • Academic Probation: -1 point
      • 3.5+ GPA: 1 point
    • Returns the housing score

A sample run of the program:

  -----------------------------------
  HOUSING SCORE CALCULATOR
  -----------------------------------

  QUESTION 1
  What year are you? (1,2,3,4): 4
  QUESTION 2
  How old are you?: 25
  QUESTION 3
  Are you currently on probation? (Yes or No): No
  QUESTION 4
  Are you Part-time or Full-time? (0 or 1): 1
  QUESTION 5
  What is your GPA?: 3.9

  -----------------------------------
  Your housing score is:  7
  -----------------------------------
  

And another sample run of the program:

  -----------------------------------
  HOUSING SCORE CALCULATOR
  -----------------------------------

  QUESTION 1
  What year are you? (1,2,3,4): 2
  QUESTION 2
  How old are you?: 19
  QUESTION 3
  Are you currently on probation? (Yes or No): Yes
  QUESTION 4
  Are you Part-time or Full-time? (0 or 1): 0
  QUESTION 5
  What is your GPA?: 2.7

  -----------------------------------
  Your housing score is:  1
  -----------------------------------
  

The grading script runs the whole program as well as each function separately ('unit tests') to determine correctness. As such, the function names must match exactly as indicated above (else, the scripts cannot find them).

Your program may assume that the input (from the user and to the functions) is always in the expected format.

In: Computer Science

Euler’s Method Let’s get our hands dirty and actually use Euler’s method to estimate the value...

Euler’s Method Let’s get our hands dirty and actually use Euler’s method to estimate the value of y(2) where y is the solution to the initial value problem

y′=y−2x             y(0) = 1

Recall that Euler’s method says: Approximate values for the solution of the initial value problem

y′=F(x, y),y(x0) =y0 with step size h, at xn=xn−1+h, are

yn=yn−1+hF(xn−1, yn−1)

Fill in the table for steps of size h= 0.2.

n xn yn=yn-1+0.2F(xn-1,Yn-1 y'=F(xn,yn)
0 0 1
1

.2

2 .4
3
4
5
6
7
8
9
10

Graph the portion of the approximate solution curve you found above. It should look like a lot of line segments. The first segment has been given on the grid below:

(c) Suppose f(x) is an exact solution to the initial value problem above. Describe, with justification, the behavior off(x) as x→∞. Hint: Graphing a slope field may be helpful for this.

In: Advanced Math

The following table lists the discount factors implied by the government spot curve for the next...

The following table lists the discount factors implied by the government spot curve for the next 4 years:

Time (years) Discount factor
1 0.951
2 0.875
3 0.802
4 0.714

What would be the price of a 4 year 3.98% coupon bond with a Z spread of 89 bps, per $100 of par value?

Enter answer in percents.

Correct answer: 82.1536

In: Finance

Consider a FA 30yr LPM 3/1 ARM with no interest rate caps and no payment caps....

Consider a FA 30yr LPM 3/1 ARM with no interest rate caps and no payment caps. The loan is for $200,000, with two points and other Regulation-Z fees of $3,000. The fixed period rate is 4% and the margin 2.5%. The underlying index at dates 0,1,2,3,4,5,6 years is 2%, 2.5%, 3%, 3.5%, 4%, 4%, 5%, respectively, and then stays at 5.5% until mortgage maturity.

What is the APR?

In: Finance

Find a polynomial f(x) of degree 3 that has the indicated zeros and satisfies the given...

Find a polynomial f(x) of degree 3 that has the indicated zeros and satisfies the given condition.

−5, 1, 2;    f(3) = 48

Find a polynomial f(x) of degree 3 that has the indicated zeros and satisfies the given condition.

−3, −2, 0;    f(−4) = 24

Find a polynomial f(x) of degree 3 that has the indicated zeros and satisfies the given condition.

−2i, 2i, 5;    f(1) = 40

Find the zeros of f(x), and state the multiplicity of each zero. (Order your answers from smallest to largest x.)

f(x) = 4x5 + 28x4 + 49x3

x = with multiplicity
x = with multiplicity

Find the zeros of f(x), and state the multiplicity of each zero. (Order your answers from smallest to largest x.)

f(x) = x(x + 1)5(3x − 7)2

x = with multiplicity   
x = with multiplicity
x = with multiplicity

Find the zeros of f(x), and state the multiplicity of each zero. (Order your answers from smallest to largest x.)

f(x) = (x2 + x − 6)2(x24)4

x= with multiplicity.   x= with multiplicity x= with multiplicity

In: Math

Regarding trade and tariffs: Draw the supply and demand curves for apples in Denmark using the...

  1. Regarding trade and tariffs:
    1. Draw the supply and demand curves for apples in Denmark using the below demand and supply schedule, and show on the graph the autarky equilibrium price and quantity.

Price

Quantity demanded

Quantity supplied

$0

8

0

$1

7

1

$2

6

2

$3

5

3

$4

4

4

$5

3

5

$6

2

6

$7

1

7

$8

0

8

  1. If the world price is $2 and Denmark opens up to free trade, how many apples will they produce, how many will they consume, and how many apples will be traded?
  2. Describe the effects of allowing free trade by explaining the change in the producer surplus and consumer surplus. Show on the graph. Who are the winners and losers? Is there a net benefit or net loss?
  3. If Denmark adds a tariff of 50% on apples, then what is the new price, how many apples will Denmark produce, how many will they consume, and how many apples will be traded?
  4. Describe the effects of the tariff by explaining the change in the producer surplus, consumer surplus, government revenue, and deadweight loss. Show on the graph. Who are the winners and losers? Does the tariff create a net benefit or a net loss?

In: Economics

Open the files for the Course Project and the data set. For each of the five...

Open the files for the Course Project and the data set.

For each of the five variables, process, organize, present, and summarize the data. Analyze each variable by itself using graphical and numerical techniques of summarization. Use Excel as much as possible, explaining what the results reveal. Some of the following graphs may be helpful: stem-leaf diagram, frequency/relative frequency table, histogram, boxplot, dotplot, pie chart, and bar graph. Caution: not all of these are appropriate for each of these variables, nor are they all necessary. More is not necessarily better. In addition, be sure to find the appropriate measures of central tendency, the measures of dispersion, and the shapes of the distributions (for the quantitative variables) for the above data. Where appropriate, use the five number summary (the Min, Q1, Median, Q3, Max). Once again, use Excel as appropriate, and explain what the results mean. Analyze the connections or relationships between the variables. There are 10 possible pairings of two variables. Use graphical as well as numerical summary measures. Explain the results of the analysis. Be sure to consider all 10 pairings. Some variables show clear relationships, whereas others do not. Report Requirements From the variable analysis above, provide the analysis and interpretation for three individual variables. This would include no more than one graph for each, one or two measures of central tendency and variability (as appropriate), the shapes of the distributions for quantitative variables, and two or three sentences of interpretation. For the 10 pairings, identify and report only on three of the pairings, again using graphical and numerical summary (as appropriate), with interpretations. Please note that at least one pairing must include a qualitative variable, and at least one pairing must not include a qualitative variable. Prepare the report in Microsoft Word, integrating graphs and tables with text explanations and interpretations. Be sure to include graphical and numerical back up for the explanations and interpretations. Be selective in what is included in the report to meet the requirements of the report without extraneous information. All DeVry University policies are in effect, including the plagiarism policy. Project Part A report is due by the end of Week 2. Project Part A is worth 100 total points. See the grading rubric below. Submission: The report, including all relevant graphs and numerical analysis along with interpretations Format for report: Brief Introduction Discuss the first individual variable, using graphical, numerical summary and interpretation. Discuss the second individual variable, using graphical, numerical summary and interpretation. Discuss the third individual variable, using graphical, numerical summary and interpretation. Discuss the first pairing of variables, using graphical, numerical summary and interpretation. Discuss the second pairing of variables, using graphical, numerical summary and interpretation. Discuss the third pairing of variables, using graphical, numerical summary and interpretation. Conclusion

Sales (Y) Calls (X1) Time (X2) Years (X3) Type
48 168 12.3 5 ONLINE
36 131 16.4 4 NONE
46 162 15.7 3 NONE
47 183 13.0 3 ONLINE
44 177 15.3 3 ONLINE
49 181 12.4 2 ONLINE
35 123 19.0 3 NONE
46 169 14.8 3 GROUP
44 158 13.9 1 GROUP
39 146 15.4 3 GROUP
48 178 12.6 4 ONLINE
42 142 17.0 0 ONLINE
45 137 13.0 2 ONLINE
54 195 15.2 2 ONLINE
43 146 16.4 0 ONLINE
44 165 17.4 3 ONLINE
34 121 13.2 2 NONE
44 146 16.5 1 NONE
40 132 18.2 1 NONE
51 182 17.9 2 ONLINE
41 151 18.0 1 NONE
45 146 15.6 3 ONLINE
52 190 13.2 3 ONLINE
39 150 19.4 0 GROUP
41 149 13.2 3 GROUP
45 167 14.5 4 GROUP
46 189 20.0 1 GROUP
47 162 16.4 3 ONLINE
42 147 13.2 3 GROUP
45 171 19.4 2 ONLINE
44 165 15.0 0 ONLINE
50 175 15.1 3 ONLINE
46 161 13.2 3 GROUP
53 188 11.0 2 ONLINE
39 136 17.3 0 NONE
39 135 17.7 1 ONLINE
48 168 15.9 5 ONLINE
46 167 10.1 0 ONLINE
43 150 17.4 3 GROUP
44 151 15.2 2 GROUP
42 141 12.2 3 NONE
39 131 19.4 2 NONE
49 174 18.3 0 ONLINE
41 154 14.5 4 NONE
42 131 20.2 3 GROUP
39 128 15.3 1 GROUP
37 126 13.4 4 NONE
46 180 15.1 4 NONE
45 166 19.5 5 NONE
44 152 16.0 2 ONLINE
50 179 12.8 3 ONLINE
39 140 18.2 1 NONE
43 154 15.3 1 ONLINE
45 164 17.2 3 ONLINE
42 139 18.6 2 NONE
44 165 19.2 2 NONE
45 172 12.6 3 GROUP
41 147 18.5 3 GROUP
43 152 17.2 1 GROUP
48 160 15.8 2 ONLINE
42 159 13.6 4 GROUP
46 186 14.1 3 GROUP
46 150 20.7 2 GROUP
43 155 11.2 3 ONLINE
45 157 16.3 4 ONLINE
48 170 12.1 1 ONLINE
45 175 18.3 2 GROUP
49 186 17.5 1 GROUP
51 181 11.4 4 GROUP
47 171 17.3 2 ONLINE
50 185 16.4 0 ONLINE
39 146 15.8 1 GROUP
42 156 18.6 2 GROUP
46 157 19.3 2 ONLINE
43 163 11.7 1 GROUP
54 175 14.2 1 ONLINE
51 175 12.0 2 ONLINE
50 173 13.3 1 ONLINE
41 140 14.9 3 NONE
43 156 20.5 2 ONLINE
40 146 18.2 2 NONE
42 148 10.5 2 GROUP
50 183 11.7 1 GROUP
49 191 13.1 2 GROUP
40 149 14.2 4 ONLINE
40 143 18.3 2 NONE
47 185 15.2 2 ONLINE
41 136 17.4 3 GROUP
51 198 13.0 1 ONLINE
43 153 13.2 3 GROUP
38 129 15.2 3 NONE
44 158 11.8 3 ONLINE
43 149 12.7 1 GROUP
47 175 13.9 2 GROUP
40 154 16.4 3 GROUP
43 151 14.3 1 GROUP
46 153 22.0 0 ONLINE
46 167 14.8 1 ONLINE
46 167 15.8 0 ONLINE
39 143 17.7 3 NONE

In: Math

Define exposure, potential dose, and internal dose Using a specific pollutant for each exposure route (dermal,...

Define exposure, potential dose, and internal dose Using a specific pollutant for each exposure route (dermal, ingestion, inhalation), explain at least two different factors that may affect each dose as it sequentially moves through each exposure pathway.

Answer requirements:

1. Define: potential dose, internal dose, exposure

2. Specific pollutant for ingestion

1. Factor 1 that affects potential dose, internal dose, exposure

2.Factor 2 that affects potential dose, internal dose, exposure

3. Specific pollutant for inhalation

1.Factor 1 that affects potential dose, internal dose, exposure

2.Factor 2 that affects potential dose, internal dose, exposure

4. Specific pollutant for dermal

1. Factor 1 that affects potential dose, internal dose, exposure

2.Factor 2 that affects potential dose, internal dose, exposure

In: Nursing

Develop a C++ program that plays out a round of Rock, Paper, Scissors using Functional Programming...

Develop a C++ program that plays out a round of Rock, Paper, Scissors using Functional Programming

1) Develop a function that prompts the user to enter their choice (1=Rock 2=Paper 3=Scissors)

  • Return either a 1, 2, or 3 depending on the value the user has entered
  • Do not continue the program until the user has entered a valid choice of 1, 2, 3

2) Develop a function that generates the computer player's choice

  • Return either a 1, 2, or 3 depending on random number generation

3) Develop a function that displays which player won the game round

  • Display the computer's choice here in this function
  • Rock (1) beats scissors(3)
  • Scissors(3) beats paper (2)
  • Paper(2) beats rock (1)
  • Ties should be displayed (1,1) (2,2) (3,3)

4) Develop your main function to play one round of RPS versus a randomized computer opponent

In: Computer Science

A social scientist would like to analyze the relationship between educational attainment (in years of higher...

A social scientist would like to analyze the relationship between educational attainment (in years of higher education) and annual salary (in $1,000s). He collects data on 20 individuals. A portion of the data is as follows:

Salary Education
35 4
71 1
84 3
52 3
70 7
80 5
107 9
55 0
23 4
33 6
102 6
40 4
67 2
68 5
163 9
55 0
83 8
56 3
125 11
31 0

a. Find the sample regression equation for the model: Salary = β0 + β1Education + ε. (Round answers to 2 decimal places.)

Salaryˆ=Salary^= _____ + _____ Education


b. Interpret the coefficient for Education.

  • As Education increases by 1 unit, an individual’s annual salary is predicted to increase by $7,160.

  • As Education increases by 1 unit, an individual’s annual salary is predicted to decrease by $8,590.

  • As Education increases by 1 unit, an individual’s annual salary is predicted to increase by $8,590.

  • As Education increases by 1 unit, an individual’s annual salary is predicted to decrease by $7,160.

c. What is the predicted salary for an individual who completed 6 years of higher education? (Round coefficient estimates to at least 4 decimal places and final answer to the nearest whole number.)

SalaryˆSalary^ $_______

In: Statistics and Probability