Questions
Purpose Review and reinforcement of pointers, dynamic memory allocation, pointer arithmetic, passing pointers to a function,...

Purpose

Review and reinforcement of pointers, dynamic memory allocation, pointer arithmetic, passing pointers to a function, returning a pointer by a function, dangling pointer, and memory deallocation, pointer initialization, and struct data type.

Project description

In this project, you will create a database of employees of an organization while meeting the requirements described below. Your program MUST NOT interact with the user to receive inputs, so that the instructor and/or the teaching assistant can save a big time in testing programs.

  1. Construction of a Database of Employees
  1. Employee

Employee is a struct data type that has the following attributes, or data members, or data fields

struct Employee {

string firstName;

string lastName;

int     SSN;

string department;

Role    role;

double salary;

};

The data type Role is defined as below.

enum Role {programmer, manager, director};

Define Employee.h and include the two data types above in the file. Role must be defined before Employee because Employee uses Role.

  1. Create an array of employees (considered as a database) with the size of 5 by using one single dynamic memory allocation
  2. Set the salaries of employees by defining and calling setSalaries() in which each employee is given a salary with a random number ranging from 45000 to 65000
  3. Set the roles of employees by defining and setRoles() in which each employee is given a random role
  4. In order to fill out other data members of each employee, you can do hardcoding or apply random number generator and/or string manipulation or any of your choice, as long as your program does not interact with the user.
  5. Display on the console information of all employees using a table format

  1. Display of the Statistics
    1. Display the average salary of the employees on the console
    2. Display the information of programmers only on the console

  1. Memory management
  1. Release any dynamically allocated memory in your program without memory leak
  2. Reset any pointer variable if it is no longer used. Otherwise, such a pointer variable becomes a dangling pointer pointing to a memory that has been deleted already.
  1. Readability
    1. Apply indentations appropriately to make your program readable.

  1. Others
  1. No need of classes/objects
  2. No need of makefile

In: Computer Science

A new company is planning to build a new database system for holding information about customers...

A new company is planning to build a new database system for holding information about customers and salesmen. ‘Customers’, ‘Salesmen’ and ‘Customers_Salesmen’ are part of the information that the new company wants to store in the new database. These tables are shown below in figure 1, figure 2 and figure 3. The new company intends to use MySQL for building the new database.

Customer_ID

Customer_Name

Customer_City

Customer_Grade

3002

Ahmad Salman

New York

100

3007

Mazen Ali

New York

200

3005

Sami Khalil

California

200

3008

Ashraf Ahmad

London

300

3004

Manal Faris

Paris

300

3009

Tahani Mahdi

Berlin

100

3003

Fawzi Jama

Moscow

200

3001

Tareq Mohsen

London

100

Figure 1: Customers table

Salesman_ID

Salesman_Name

Salesman_City

Salesman_Commission

5001

Naser Hamad

New York

0.15

5002

Rami Farhan

Paris

0.13

5006

Salem Alawi

Paris

0.14

5003

Faten Morad

San Jose

0.12

5007

Turkey Fahad

Rome

0.13

5005

Juma Khalaf

London

0.11

Figure 2: Salesmen table

Customer_ID

Salesman_ID

3002

5001

3007

5001

3005

5002

3008

5002

3004

5006

3009

5003

3003

5007

3001

5005

Figure 3: Customers_Salesmen table

Based on the above three tables, answer the following 6 questions:

  1. Write an SQL statement for creating the customer table that is shown in figure 2. No need to write any SQL statement for adding any record to the customer table.  
  2. Write an SQL statement for adding one record to the customer table that was created in question-1 above. The added record should be one of the records that are given in the customer table.   
  3. Write an SQL statement to list the information of salesmen who work in Paris.
  4. Write an SQL statement to list all customer names who work with the salesman whose id is 5001.                                                                                                                           \
  5. Write an SQL statement to list all customer names who work with the salesman whose commission is 0.13.                                                                                                          ]
  6. Write an SQL statement to increase the salesman commission by 5%.

In: Computer Science

Year Money Supply (M2) Nominal GDP Velocity of Money(ratio) Consumer Price Index 1995 3,492.40 10543.644 2.155...

Year Money Supply (M2) Nominal GDP Velocity of Money(ratio) Consumer Price Index
1995 3,492.40 10543.644 2.155 2.87081
1996 3,647.90 10817.896 2.147 2.79070
1997 3,824.80 11284.587 2.179 3.03814
1998 4,046.30 11832.486 2.175 1.63112
1999 4,393.10 12403.293 2.135 1.66667
2000 4,656.30 12924.179 2.139 2.79296
2001 4,965.00 13222.690 2.090 3.72120
2002 5,440.10 13397.002 1.975 1.19590
2003 5,790.40 13634.253 1.921 2.75746
2004 6,061.10 14221.147 1.954 2.02629
2005 6,410.60 14771.602 1.988 2.84487
2006 6,709.90 15267.026 2.021 4.01879
2007 7,094.80 15493.328 1.997 2.07577
2008 7,491.10 15671.383 1.936 4.29470
2009 8,262.40 15155.940 1.733 -0.11359
2010 8,445.60 15415.145 1.736 2.62111
2011 8,825.80 15712.754 1.723 1.70078
2012 9,730.20 16129.418 1.639 3.00877
2013 10,471.40 16382.964 1.579 1.68406

We had two financial crises since 2000, 2000 dot.com bubble, 2008-2009 financial crisis. From FRED website, find the following data from 1995 to 2013, and make a graph. Explain the general trends of each series, and compare them between the two crises.

  1. Money supply (M2)
  2. Nominal GDP
  3. Velocity of Money
  4. Consumer Price Index

In: Economics

Workers are compensated by firms with “benefits” in addition to wages and salaries. The most prominent benefit offered by many firms is health insurance.

Workers are compensated by firms with “benefits” in addition to wages and salaries. The most prominent benefit offered by many firms is health insurance. Suppose that in 2000, workers at one steel plant were paid $30 per hour and in addition received health benefits at the rate of $6 per hour. Also suppose that by 2010 workers at that plant were paid $31.5 per hour but received $13.5 in health insurance benefits. 

a. By what percentage did total compensation (wages plus benefits) change at this plant from 2000 to 2010? Instructions: Round your answer to 2 decimal places. Total compensation by: What was the approximate average annual percentage change in total compensation? Instructions: Round your answer to 2 decimal places. 

b. By what percentage did wages change at this plant from 2000 to 2010? Instructions: Enter your answer as a whole number. Wages by: What was the approximate average annual percentage change in wages? Instructions: Round your answer to 1 decimal place. 

c. If workers value a dollar of health benefits as much as they value a dollar of wages, by what total percentage will they feel that their incomes have risen over this time period? Instructions: Round your answer to 2 decimal places. What if they only consider wages when calculating their incomes? Incomes by: 

d. Is it possible for workers to feel as though their wages are stagnating even if total compensation is rising?

In: Economics

Between 2000 and 2009, real output per person in the emerging world grew at an average...

Between 2000 and 2009, real output per person in the emerging world grew at an average annual rate of 7.6%, 4.5 percentage points higher than the rate seen in rich countries. As a result, the gap between the developed and developing worlds narrowed quickly over the period. Since 2009, growth rates in the developing world have dropped and were only 1.1 percentage points higher than developed countries in 2013. Projections for 2014 put growth in developing countries just 0.39 percentage points above those in developed countries.

a) Use the economic growth model to explain the convergence hypothesis. Include a diagram in your response.

b) Discuss what factors could have driven the rapid growth in the developing world from 2000-2009.

c) What factors are important to sustain long run growth in these developing economies? Explain.

d) In 2009, per capita GDP in developed economies was on average 3.6 times as large as in developing economies. If per capita growth maintained the same rates as between 2000 and 2009, it would take about 30 years for developing countries to catch up to the developed world. If per capita growth slows to 4.2% in developing countries and remains at 3.1% in developed countries, how many years would it take developing economies to catch up to developed economies? (Round to the nearest year)

In: Economics

Between 2000 and 2009, real output per person in the emerging world grew at an average...

Between 2000 and 2009, real output per person in the emerging world grew at an average annual rate of 7.6%, 4.5 percentage points higher than the rate seen in rich countries. As a result, the gap between the developed and developing worlds narrowed quickly over the period. Since 2009, growth rates in the developing world have dropped and were only 1.1 percentage points higher than developed countries in 2013. Projections for 2014 put growth in developing countries just 0.39 percentage points above those in developed countries. a) Use the economic growth model to explain the convergence hypothesis. Include a diagram in your response. b) Discuss what factors could have driven the rapid growth in the developing world from 2000- 2009. c) What factors are important to sustain long run growth in these developing economies? Explain. d) In 2009, per capita GDP in developed economies was on average 3.6 times as large as in developing economies. If per capita growth maintained the same rates as between 2000 and 2009, it would take about 30 years for developing countries to catch up to the developed world. If per capita growth slows to 4.2% in developing countries and remains at 3.1% in developed countries, how many years would it take developing economies to catch up to developed economies? (Round to the nearest year)

In: Economics

A business journal investigation of the performance and timing of corporate acquisitions discovered that in a...

A business journal investigation of the performance and timing of corporate acquisitions discovered that in a random sample of 2 ,767 ​firms, 705 announced one or more acquisitions during the year 2000. Does the sample provide sufficient evidence to indicate that the true percentage of all firms that announced one or more acquisitions during the year 2000 is less than 27​%?

Use α=0.10 to make your decision. What are the hypotheses for this​ test?

A. H0​: p<0.27

Ha​: p=0.27

B. H0​: p≠0.27

Ha​: p=0.27

C. H0: p=0.27

Ha: p<0.27

D. H0​: p=0.27

Ha​: p>0.27

E. H0​: p>0.27

Ha​: ≤0.27

F. H0​: p=0.27

Ha​: p≠0.27

What is the rejection​ region? Select the correct choice below and fill in the answer​ box(es) to complete your choice.

​(Round to two decimal places as​ needed.)

A. z<_________ orz>_________

B. z<___________

C.z>___________

Calculate the value of the​ z-statistic for this test.

z=_________ (Round to two decimal places as​ needed.)

What is the conclusion of the​ test?

Reject

Do not reject

the null hypothesis because the test statistic

is

is not

in the rejection region.​Therefore, there is

insufficient

sufficient

evidence at the 0.10

level of significance to indicate that the true percentage of all firms that announced one or more acquisitions during the year 2000 is less than 27​%.

In: Statistics and Probability

Universal Technologies, Inc. has identified two qualified vendors with the capability to supply some of its...

Universal Technologies, Inc. has identified two qualified vendors with the capability to supply some of its electronic components. For the coming year, Universal has estimated its volume requirements for these components and obtained price-break schedules from each vendor. (These are summarized as “all-units” discounts in the table below.) Universal’s engineers have also estimated each vendor’s maximum capacity for producing these components, based on available information about equipment in use and labor policies in effect. Finally, because of its limited history with Vendor A, Universal has adopted a policy that permits no more than 60% of its total unit purchases on these components to come from Vendor A.

Vendor A

Vendor B

Product

Requirement

Unit price

Volume required

Unit price

Volume required

1

500

$225

0–250

$224

0–300

$220

250–500

$214

300–500

2

1000

$124

0–600

$120

0–1000

$115

600–1000

(no discount)

3

2500

$60

0–1000

$54

0–1500

$56*

1000–2000

$52

1500–2500

$51

2000–2500

Total capacity (units)

2500

2000

*For example, if 1400 units are purchased from Vendor A, they cost $56 each, for a total of $78,400.

What is the minimum-cost purchase plan for Universal?

In: Operations Management

Sherrod, Inc., reported pretax accounting income of $84 million for 2018. The following information relates to...

Sherrod, Inc., reported pretax accounting income of $84 million for 2018. The following information relates to differences between pretax accounting income and taxable income:

Income from installment sales of properties included in pretax accounting income in 2018 exceeded that reported for tax purposes by $3 million. The installment receivable account at year-end had a balance of $4 million (representing portions of 2017 and 2018 installment sales), expected to be collected equally in 2019 and 2020.

Sherrod was assessed a penalty of $4 million by the Environmental Protection Agency for violation of a federal law in 2018. The fine is to be paid in equal amounts in 2018 and 2019.

Sherrod rents its operating facilities but owns one asset acquired in 2017 at a cost of $88 million. Depreciation is reported by the straight-line method assuming a four-year useful life. On the tax return, deductions for depreciation will be more than straight-line depreciation the first two years but less than straight-line depreciation the next two years ($ in millions):

Income Statement Tax Return Difference
2017 $ 22 $ 29 $ (7 )
2018 22 36 (14 )
2019 22 13 9
2020 22 10 12
$ 88 $ 88 $ 0

Warranty expense of $3 million is reported in 2018. For tax purposes, the expense is deducted when costs are incurred, $2 million in 2018. At December 31, 2018, the warranty liability was $2 million (after adjusting entries). The balance was $1 million at the end of 2017.

In 2018, Sherrod accrued an expense and related liability for estimated paid future absences of $8 million relating to the company’s new paid vacation program. Future compensation will be deductible on the tax return when actually paid during the next two years ($5 million in 2019; $3 million in 2020).

During 2017, accounting income included an estimated loss of $4 million from having accrued a loss contingency. The loss is paid in 2018 at which time it is tax deductible.


Balances in the deferred tax asset and deferred tax liability accounts at January 1, 2018, were $2.0 million and $3.2 million, respectively. The enacted tax rate is 40% each year.

1. Determine the amounts necessary to record income taxes for 2018 and prepare the appropriate journal entry.

2. Show how any deferred tax amounts should be classified and reported in the 2018 balance sheet.​

In: Accounting

Question 2. Go to the Blackboard and download the MS excel file, ‘stock_return.xlsx’. It contains a...

Question 2. Go to the Blackboard and download the MS excel file, ‘stock_return.xlsx’. It contains a year of monthly stock price data of Amazon, Pfizer, and S&P 500 (Market Index). Using the data, answer the following questions. (50 points)

(1) Compute the monthly return of Amazon and Pfizer. You should get 12 monthly returns for each. To get a monthly return, you need to use previous month’s stock price. For example, Amazon’s stock return of 2018-01 will be [(Stock price of 2018-01) - (Stock price of 2017-12)] / (Stock price of 2017-12) (5 points)

(2) Compute the average stock return (arithmetic average), standard deviation, and holding period return for Amazon and Pfizer. Use Excel function of =AVERAGE() for average return, =STDEV.S() for standard deviation, and =PRODUCT() for holding period return. (10 points)

(3) Form a portfolio investing 50% of your money into Amazon and 50% into Pfizer.

Calculate the monthly return for each month of the portfolio. Then, provide arithmetic average and standard deviation of the portfolio return. Check and report whether the linear combination (weighted average) of standard deviation of two companies is smaller than portfolio’s standard deviation or not. (15 points)

(4) Calculate the monthly market return, average market return, and market variance using S&P500 Index. Using the variance of market return and covariance between market return and Amazon’s return, calculate the Amazon’s beta. Use =VAR.S() for variance and =COVARIANCE.S() function to get covariance (15 points)

(5) Suppose risk free rate is 1% and expected market return is 5%. Compute the expected return of Amazon using CAPM. You would get the beta in (4) (5 points)

Date

Stock Price

Amazon

Pfizer

S&P 500

2017/12

1169,47

33,38

2673,61

2018/01

1450,89

34,13

2823,81

2018/02

1512,45

33,46

2713,83

2018/03

1447,34

33,01

2640,87

2018/04

1566,13

34,05

2648,05

2018/05

1629,62

33,42

2705,27

2018/06

1699,80

34,07

2718,37

2018/07

1777,44

37,50

2816,29

2018/08

2012,71

38,99

2901,52

2018/09

2003,00

41,74

2913,98

2018/10

1598,01

40,78

2711,74

2018/11

1690,17

43,79

2760,17

2018/12

1501,97

41,66

2506,85

In: Finance