Summary In this lab, you write a while loop that uses a sentinel value to control a loop in a C++ program that has been provided. You also write the statements that make up the body of the loop. The source code file already contains the necessary variable declarations and output statements. Each theater patron enters a value from 0 to 4 indicating the number of stars the patron awards to the Guide’s featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, you should display the average star rating for the movie. Instructions Ensure the source code file named MovieGuide.cpp is open in your code editor. Write the while loop using a sentinel value to control the loop, and write the statements that make up the body of the loop. The output statements within the loop have already been written for you. Ensure you include the calculations to compute the average rating. Execute the program by clicking the Run button. Input the following: 0, 3, 4, 4, 1, 1, 2, -1 Ensure the average output is correct.
this is the prewritten code:
// MovieGuide.cpp - This program allows each theater patron to enter a value from 0 to 4
// indicating the number of stars that the patron awards to the Guide's featured movie of the
// week. The program executes continuously until the theater manager enters a negative number to
// quit. At the end of the program, the average star rating for the movie is displayed.
#include <iostream>
#include <string>
using namespace std;
int main()
{
// Declare and initialize variables.
double numStars; // star rating.
double averageStars; // average star rating.
double totalStars = 0; // total of star ratings.
int numPatrons = 0; // keep track of number of patrons
// This is the work done in the housekeeping() function
// Get input.
cout << "Enter rating for featured movie: ";
cin >> numStars;
// This is the work done in the detailLoop() function
// Write while loop here
// This is the work done in the endOfJob() function
cout << "Average Star Value: " << averageStars << endl;
return 0;
} // End of main()
In: Computer Science
Find as many programming languages as possible which fit the following categories. When you find a language which fits the category, indicate the following information:
For full marks, you must find at least two languages for each category. To make the assignment more interesting, extra points will be awarded to the person who finds the most languages for each category. (That is, extra points are available for each of the categories.)
Categories
In: Computer Science
Please don't copy and paste from other website.
Outline the key fiscal and monetary policy actions, respectively, of New Zealand against the COVID-19 shocks(already outlined below)
use appropriate macroeconomic models and theories covered in this course to explain their expected impacts. Discuss any limitations of these policy actions. (~600 words)
TIPS:
⮚ If there are many policy actions, you could list all of them but focus on the key ones for discussion.
⮚ The government may take multiple actions (e.g. subsidising firms; providing cash handouts to households) and each action may have different impacts and effectiveness. ⮚ Fiscal and monetary policy actions have different limitations (e.g. effect lags; ability to target specific sectors). You should discuss their relative effectiveness in dealing with the pandemic shocks.
⮚ You could discuss how the behaviours of households and businesses, and the prepandemic macroeconomic conditions (e.g. very low interest rates) may affect the effectiveness of the policy actions.
⮚ You could discuss the potential drawbacks of the policy actions (e.g. building up of debts; inflating asset bubbles).
⮚ You could contrast the policy actions of your countries with some other countries if that helps to explain the pros and cons of the policy actions of New Zealand
Key Policy Responses as of October 8, 2020
FISCAL
With the FY2020-21 budget and previous fiscal packages, the government has announced fiscal measures amounting to a total of NZ$58.5 billion (19.5 percent of GDP) through FY2023-24. The total amount includes the COVID-19 Response and Recovery Fund, of which NZ$14.1 billion have been set aside as contingency for a possible second wave. Announced fiscal measures include: (i) healthcare-related spending to reinforce capacity (NZ$0.8 billion or 0.3 percent of GDP); (ii) a permanent increase in social spending to protect vulnerable people (total NZ$2.4 billion or 0.8 percent of GDP); (iii) a wage subsidy to support employers severely affected by the impact of COVID-19 (NZ$14.8 billion or 4.9 percent of GDP); (iv) income relief payments to support people who lost their jobs (NZ$0.6 billion or 0.2 percent of GDP); (v) a permanent change in business taxes to help cashflow (NZ$2.8 billion or 0.9 percent of GDP); (vi) infrastructure investment (NZ$3.8 billion or 1.3 percent of GDP); (vii) transport projects (NZ$0.6 billion or 0.2 percent of GDP); (viii) a temporary tax loss carry-back scheme (NZ$3.1 billion or 1.0 percent of GDP); (ix) support for the aviation sector (NZ$0.6 billion or 0.2 percent of GDP); (x) a tourism recovery package (NZ$0.4 billion or 0.1 percent of GDP); (xi) a government housing program (NZ$0.7 billion or 0.2 percent of GDP); and (xii) school infrastructure upgrades (NZ$0.2 billion or 0.1 percent of GDP). The government has also approved a NZ$0.9 billion debt funding agreement (convertible to equity) with Air New Zealand to ensure continued freight operations, domestic flights and limited international flights. The New Zealand government also provides loans of up to NZ$100,000 to small businesses that employ 50 or less employees (NZ$5.2 billion). In addition, on March 28 the government announced temporary removal of tariffs on all medical and hygiene imports needed for the COVID-19 response.
MONETARY AND MACRO-FINANCIAL
The Reserve Bank of New Zealand (RBNZ) kept the official cash rate (OCR) at 0.25 percent on September 23, unchanged since the OCR was reduced by 75 basis points on March 17. In August, to further ease monetary policy, the RBNZ expanded the Large-Scale Asset Purchase program (LSAP) to purchase government bonds and Local Government Funding Agency (LGFA) in the secondary market from up to NZ$60 billion for 12 months to a maximum of NZ$100 billion by June 2022. It also announced that a package of additional monetary instruments will remain in active preparation for a possible need for further monetary stimulus, depending on the outlook for inflation and employment. The package of additional instruments includes a negative OCR supported by a Funding for Lending Program (funding retail banks directly at near-OCR) and purchases of foreign assets.
Since March, the RBNZ has been providing liquidity in the FX swap market and re-established a temporary US dollar swap line (US$30 billion) with the U.S. Federal Reserve. The RBNZ has established a new Term Auction Facility (TAF), which allows banks access to collateralized loans of up to 12 months, and announced a corporate facility in which the RBNZ will offer up to NZ$500 million per week in open market operations with banks against corporate paper and asset-backed securities for 3 months. The RBNZ has also introduced a Term Lending Facility (TLF), a longer-term funding scheme for banks at 0.25 percent for up to 3 years duration initially for six months from May 26. From August 26, the lending term of the TLF has been extended to 5 years and the facility has been extended to Feb 1, 2021. Access to the TLF is linked to each banks’ lending under a NZ$6.25 billion Business Finance Guarantee Scheme (BFGS) in which the government covers 80 percent of the credit risk and will require approved eligible collateral. The BFGS was expanded in August, increasing the maximum loan amount from NZ$0.5 million to NZ$5 million, lengthening the maximum term from three to five years, and allowing more loan access by medium-sized firms. The RBNZ has reduced the banks’ core funding ratio requirement to 50 percent from 75 percent to help banks make credit available.
To further support the stability of the financial system, the start date for a regulatory change requiring higher capital for banks has been postponed for 12 months, to July 2021 (to support up to about NZ$47 billion of additional lending), with other regulatory initiatives in the pipeline also put on hold for at least six months. The RNBZ has also agreed with the banks that during this period there will be no dividend payments on ordinary shares and redemption of non-CET1 capital instruments. The RBNZ has removed, effective as of May 1, mortgage loan-to-value ratio (LVR) restrictions for the next 12 months.
The New Zealand government, the RBNZ, and the New Zealand Bankers Association have also announced a number of financial measures to support SMEs and homeowners. These include six-month principal and interest repayment deferrals to mortgage holders and SMEs affected by COVID-19 and the BFGS.
Other related measures taken by the government that could contribute to financial stability include a six-month freeze on residential rent increases until September 25 and restrictions against tenancy terminations during March-June. The Business Debt Hibernation process allows businesses to place their existing debts on hold for up to seven months.
EXCHANGE RATE AND BALANCE OF PAYMENTS
The exchange rate has been allowed to adjust flexibly.
In: Economics
Write the Policy Responses in New Zealand (~600 words)
Outline the key fiscal and monetary policy actions, respectively, of New Zealand against the COVID-19 shocks(already outlined below) and use appropriate macroeconomic models and theories covered in this course to explain their expected impacts. Discuss any limitations of these policy actions.
TIPS:
⮚ If there are many policy actions, you could list all of them but focus on the key ones for discussion.
⮚ The government may take multiple actions (e.g. subsidising firms; providing cash handouts to households) and each action may have different impacts and effectiveness. ⮚ Fiscal and monetary policy actions have different limitations (e.g. effect lags; ability to target specific sectors). You should discuss their relative effectiveness in dealing with the pandemic shocks.
⮚ You could discuss how the behaviours of households and businesses, and the prepandemic macroeconomic conditions (e.g. very low interest rates) may affect the effectiveness of the policy actions.
⮚ You could discuss the potential drawbacks of the policy actions (e.g. building up of debts; inflating asset bubbles).
⮚ You could contrast the policy actions of your countries with some other countries if that helps to explain the pros and cons of the policy actions of New Zealand
Key Policy Responses as of October 8, 2020
FISCAL
With the FY2020-21 budget and previous fiscal packages, the government has announced fiscal measures amounting to a total of NZ$58.5 billion (19.5 percent of GDP) through FY2023-24. The total amount includes the COVID-19 Response and Recovery Fund, of which NZ$14.1 billion have been set aside as contingency for a possible second wave. Announced fiscal measures include: (i) healthcare-related spending to reinforce capacity (NZ$0.8 billion or 0.3 percent of GDP); (ii) a permanent increase in social spending to protect vulnerable people (total NZ$2.4 billion or 0.8 percent of GDP); (iii) a wage subsidy to support employers severely affected by the impact of COVID-19 (NZ$14.8 billion or 4.9 percent of GDP); (iv) income relief payments to support people who lost their jobs (NZ$0.6 billion or 0.2 percent of GDP); (v) a permanent change in business taxes to help cashflow (NZ$2.8 billion or 0.9 percent of GDP); (vi) infrastructure investment (NZ$3.8 billion or 1.3 percent of GDP); (vii) transport projects (NZ$0.6 billion or 0.2 percent of GDP); (viii) a temporary tax loss carry-back scheme (NZ$3.1 billion or 1.0 percent of GDP); (ix) support for the aviation sector (NZ$0.6 billion or 0.2 percent of GDP); (x) a tourism recovery package (NZ$0.4 billion or 0.1 percent of GDP); (xi) a government housing program (NZ$0.7 billion or 0.2 percent of GDP); and (xii) school infrastructure upgrades (NZ$0.2 billion or 0.1 percent of GDP). The government has also approved a NZ$0.9 billion debt funding agreement (convertible to equity) with Air New Zealand to ensure continued freight operations, domestic flights and limited international flights. The New Zealand government also provides loans of up to NZ$100,000 to small businesses that employ 50 or less employees (NZ$5.2 billion). In addition, on March 28 the government announced temporary removal of tariffs on all medical and hygiene imports needed for the COVID-19 response.
MONETARY AND MACRO-FINANCIAL
The Reserve Bank of New Zealand (RBNZ) kept the official cash rate (OCR) at 0.25 percent on September 23, unchanged since the OCR was reduced by 75 basis points on March 17. In August, to further ease monetary policy, the RBNZ expanded the Large-Scale Asset Purchase program (LSAP) to purchase government bonds and Local Government Funding Agency (LGFA) in the secondary market from up to NZ$60 billion for 12 months to a maximum of NZ$100 billion by June 2022. It also announced that a package of additional monetary instruments will remain in active preparation for a possible need for further monetary stimulus, depending on the outlook for inflation and employment. The package of additional instruments includes a negative OCR supported by a Funding for Lending Program (funding retail banks directly at near-OCR) and purchases of foreign assets.
Since March, the RBNZ has been providing liquidity in the FX swap market and re-established a temporary US dollar swap line (US$30 billion) with the U.S. Federal Reserve. The RBNZ has established a new Term Auction Facility (TAF), which allows banks access to collateralized loans of up to 12 months, and announced a corporate facility in which the RBNZ will offer up to NZ$500 million per week in open market operations with banks against corporate paper and asset-backed securities for 3 months. The RBNZ has also introduced a Term Lending Facility (TLF), a longer-term funding scheme for banks at 0.25 percent for up to 3 years duration initially for six months from May 26. From August 26, the lending term of the TLF has been extended to 5 years and the facility has been extended to Feb 1, 2021. Access to the TLF is linked to each banks’ lending under a NZ$6.25 billion Business Finance Guarantee Scheme (BFGS) in which the government covers 80 percent of the credit risk and will require approved eligible collateral. The BFGS was expanded in August, increasing the maximum loan amount from NZ$0.5 million to NZ$5 million, lengthening the maximum term from three to five years, and allowing more loan access by medium-sized firms. The RBNZ has reduced the banks’ core funding ratio requirement to 50 percent from 75 percent to help banks make credit available.
To further support the stability of the financial system, the start date for a regulatory change requiring higher capital for banks has been postponed for 12 months, to July 2021 (to support up to about NZ$47 billion of additional lending), with other regulatory initiatives in the pipeline also put on hold for at least six months. The RNBZ has also agreed with the banks that during this period there will be no dividend payments on ordinary shares and redemption of non-CET1 capital instruments. The RBNZ has removed, effective as of May 1, mortgage loan-to-value ratio (LVR) restrictions for the next 12 months.
The New Zealand government, the RBNZ, and the New Zealand Bankers Association have also announced a number of financial measures to support SMEs and homeowners. These include six-month principal and interest repayment deferrals to mortgage holders and SMEs affected by COVID-19 and the BFGS.
Other related measures taken by the government that could contribute to financial stability include a six-month freeze on residential rent increases until September 25 and restrictions against tenancy terminations during March-June. The Business Debt Hibernation process allows businesses to place their existing debts on hold for up to seven months.
EXCHANGE RATE AND BALANCE OF PAYMENTS
The exchange rate has been allowed to adjust flexibly.
In: Economics
James Simons built the most successful hedge fund, Renaissance, in the world. He built it violating the efficient market hypotheses. What form of the efficient market hypotheses did James Simons violate?
In: Economics
Hadoop has HDFS, which is the default built in FileSystem. Cloudera use this built-in default Java implementation. MapR has taken a different approach. What approach has MapR taken in its FileSystem implementation, and what may be the advantages and disadvantages of MapR's approach versus other vendors? If there are disadvantages, how can they be addressed? Look at the advantages and disadvantages from user, developer, administrator and risk perspective.
In: Computer Science
Consider three students taking an examination. Their respective probabilities of obtaining the different available grades are shown in Table 1. (a) What is the probability that each will obtain a grade of A? (b) If two students were to receive an A, what is the probability that Jim would be among them?
Table 1. Probabilities of Individual Student Exam Grades*
Student Grade
A B C D F
Terry 0.5 0.3 0.1 0.06 0.04
Jim 0.4 0.4 0.1 0.07 0.03
Sam 0.3 0.3 0.3 0.05 0.05
* Assume each examination outcome to be independent.
In: Statistics and Probability
Question 1
A single random sample of 16 different cereals is obtained, and the sugar content (in grams of sugar per gram of cereal) is measured for each cereal selected. Those amounts have a mean of 0.295 gram and a standard deviation of 0.168 gram. The amount of sugar in all cereals is assumed to be normally distributed.
Construct a 95% confidence interval estimate of the population mean.
Degrees of freedom = [ Select ] ["14", "15", "16", "17"]
t-value = [ Select ] ["2.131", "2.120", "1.753", "1.746"] (from the table)
Margin of Error = [ Select ] ["0.0357", "0.0584", "0.0895", "0.168"]
95% Confidence Interval = [ Select ] ["0.2722 < μ < 0.3845", "0.2055 < μ < 0.3845", "0.2055 < μ < 0.3243", "0.2722 < μ < 0.3243"]
--------------------------------------------
Question 2
A single random sample of 16 different cereals is obtained, and the sugar content (in grams of sugar per gram of cereal) is measured for each cereal selected. Those amounts have a mean of 0.295 gram and a standard deviation of 0.168 gram. The amount of sugar in all cereals is assumed to be normally distributed.
Use a 0.05 significance level to test the claim of a cereal lobbyist that the mean of all cereals is less than 0.3 gram.
Hypotheses: [ Select ] ["Ho: μ = 0.3 vs. Ha: μ < 0.3", "Ho: μ = 0.3 vs. Ha: μ > 0.3", "Ho: μ < 0.3 vs. Ha: μ > 0.3", "Ho: μ < 0.3 vs. Ha: μ = 0.3"]
Type of test: [ Select ] ["Left-tailed", "Right-tailed", "Two-tailed"]
t statistic = [ Select ] ["-0.119", "0.119", "-1.753", "1.753"] (calculated with formula)
Degrees of freedom = [ Select ] ["14", "15", "16", "17"]
significance level = [ Select ] ["0.01", "0.05"]
Critical t value = [ Select ] ["1.753", "-1.753", "2.131", "-2.131"] (from table 10.1)
Decision: [ Select ] ["Reject the null hypothesis.", "Do not reject the null hypothesis."]
Conclusion: [ Select ] ["We have sufficient evidence to support the claim that the mean for all cereals is less than 0.3 gram.", "We do not have sufficient evidence to support the claim that the mean for all cereals is less than 0.3 gram."]
In: Statistics and Probability
Marsha Jones has bought a used Mercedes horse transporter for
her Connecticut estate. It cost $50,000. The object is to save on
horse transporter rentals.
Marsha had been renting a transporter every other week for $215 per
day plus $1.75 per mile. Most of the trips are 80 or 100 miles in
total. Marsha usually gives Joe Laminitis, the driver, a $40 tip.
With the new transporter she will only have to pay for diesel fuel
and maintenance, at about $0.60 per mile. Insurance costs for
Marsha’s transporter are $1,950 per year.
The transporter will probably be worth $30,000 (in real terms)
after eight years, when Marsha’s horse Spike will be ready to
retire. Assume a nominal discount rate of 7% and a 3% forecasted
inflation rate. Marsha’s transporter is a personal outlay, not a
business or financial investment, so taxes can be ignored.
Calculate the NPV of the investment. (Do not round
intermediate calculations. Round your answer to the nearest whole
dollar amount.)
In: Finance
code in R:
We will use the dataset **Auto{ISLR}** to develop a binomial classification model to predict the likelihood of automobiles having high gas mileage. So, first load the **{ISLR}** library. Since we don't have a dummy variable to classify high vs. low gas mileage vehicles, let's use the quantitative value of miles per gallon **mpg** to create a binary variable called **mpg.hi** if a vehicle has higher **mpg** than the **median mpg**. Let's first calculate the **median mpg** value using the `median()` function and store the results in an object named **med.mpg**. Then create a column in the **Auto** dataset named **mpg.hi** with a binary value of 1 if `mpg>med.mpg` and 0 otherwise, using the `ifelse()` function.
For a quick visual inspection, display the **med.mpg** value and then a 2-column data frame using `cbind()` the first 20 values for **mpg** and **mpg.hi**. Please label the columns as shown below. Don't answer this,but quickly verify that your **med.hi** variable was created correctly.
In: Statistics and Probability