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

Financial statements for Allendale Company follow: ALLENDALE COMPANY Balance Sheets As of December 31 2019 2018...

Financial statements for Allendale Company follow:

ALLENDALE COMPANY
Balance Sheets
As of December 31
2019 2018
Assets
Current assets
Cash $ 40,000 $ 36,000
Marketable securities 20,000 6,000
Accounts receivable (net) 54,000 46,000
Inventories 135,000 143,000
Prepaid items 25,000 10,000
Total current assets 274,000 241,000
Investments 27,000 20,000
Plant (net) 270,000 255,000
Land 29,000 24,000
Total assets $ 600,000 $ 540,000
Liabilities and Stockholders’ Equity
Liabilities
Current liabilities
Notes payable $ 17,000 $ 6,000
Accounts payable 113,800 100,000
Salaries payable 21,000 15,000
Total current liabilities 151,800 121,000
Noncurrent liabilities
Bonds payable 100,000 100,000
Other 32,000 27,000
Total noncurrent liabilities 132,000 127,000
Total liabilities 283,800 248,000
Stockholders’ equity
Preferred stock, (par value $10, 4% cumulative, non-participating; 8,000 shares authorized and issued) 80,000 80,000
Common stock (no par; 50,000 shares authorized; 10,000 shares issued) 80,000 80,000
Retained earnings 156,200 132,000
Total stockholders’ equity 316,200 292,000
Total liabilities and stockholders’ equity $ 600,000 $ 540,000
ALLENDALE COMPANY
Statements of Income and Retained Earnings
For the Years Ended December 31
2019 2018
Revenues
Sales (net) $ 230,000 $ 210,000
Other revenues 8,000 5,000
Total revenues 238,000 215,000
Expenses
Cost of goods sold 120,000 103,000
Selling, general, and administrative 55,000 50,000
Interest expense 8,000 7,200
Income tax expense 23,000 22,000
Total expenses 206,000 182,200
Net earnings (net income) 32,000 32,800
Retained earnings, January 1 132,000 107,000
Less: Preferred stock dividends 3,200 3,200
Common stock dividends 4,600 4,600
Retained earnings, December 31 $ 156,200 $ 132,000

Required

Calculate the following ratios for 2019 and 2018. Since 2017 numbers are not presented do not use averages when calculating the ratios for 2018. Instead, use the number presented on the 2018 balance sheet.

Working capital.

Current ratio. (Round your answers to 2 decimal places.)

Quick ratio. (Round your answers to 2 decimal places.)

Receivables turnover (beginning receivables at January 1, 2018, were $47,000). (Round your answers to 2 decimal places.)

Average days to collect accounts receivable. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.)

Inventory turnover (beginning inventory at January 1, 2018, was $140,000). (Round your answers to 2 decimal places.)

Number of days to sell inventory. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.)

Debt to assets ratio. (Round your answers to the nearest whole percent.)

Debt to equity ratio. (Round your answers to 2 decimal places.)

Number of times interest was earned. (Round your answers to 2 decimal places.)

Plant assets to long-term debt. (Round your answers to 2 decimal places.)

Net margin. (Round your answers to 2 decimal places.)

Turnover of assets. (Round your answers to 2 decimal places.)

Return on investment. (Round your answers to 2 decimal places.)

Return on equity. (Round your answers to 2 decimal places.)

Earnings per share. (Round your answers to 2 decimal places.)

Book value per share of common stock. (Round your answers to 2 decimal places.)

Price-earnings ratio (market price per share: 2018, $11.75; 2019, $12.50). (Round your intermediate calculations and final answer to 2 decimal places.)

Dividend yield on common stock. (Round your answers to 2 decimal places.)

In: Accounting

Financial statements for Allendale Company follow: ALLENDALE COMPANY Balance Sheets As of December 31 2019 2018...

Financial statements for Allendale Company follow:

ALLENDALE COMPANY
Balance Sheets
As of December 31
2019 2018
Assets
Current assets
Cash $ 40,000 $ 36,000
Marketable securities 20,000 6,000
Accounts receivable (net) 54,000 46,000
Inventories 135,000 143,000
Prepaid items 25,000 10,000
Total current assets 274,000 241,000
Investments 27,000 20,000
Plant (net) 270,000 255,000
Land 29,000 24,000
Total assets $ 600,000 $ 540,000
Liabilities and Stockholders’ Equity
Liabilities
Current liabilities
Notes payable $ 17,000 $ 6,000
Accounts payable 113,800 100,000
Salaries payable 21,000 15,000
Total current liabilities 151,800 121,000
Noncurrent liabilities
Bonds payable 100,000 100,000
Other 32,000 27,000
Total noncurrent liabilities 132,000 127,000
Total liabilities 283,800 248,000
Stockholders’ equity
Preferred stock, (par value $10, 4% cumulative, non-participating; 8,000 shares authorized and issued) 80,000 80,000
Common stock (no par; 50,000 shares authorized; 10,000 shares issued) 80,000 80,000
Retained earnings 156,200 132,000
Total stockholders’ equity 316,200 292,000
Total liabilities and stockholders’ equity $ 600,000 $ 540,000
ALLENDALE COMPANY
Statements of Income and Retained Earnings
For the Years Ended December 31
2019 2018
Revenues
Sales (net) $ 230,000 $ 210,000
Other revenues 8,000 5,000
Total revenues 238,000 215,000
Expenses
Cost of goods sold 120,000 103,000
Selling, general, and administrative 55,000 50,000
Interest expense 8,000 7,200
Income tax expense 23,000 22,000
Total expenses 206,000 182,200
Net earnings (net income) 32,000 32,800
Retained earnings, January 1 132,000 107,000
Less: Preferred stock dividends 3,200 3,200
Common stock dividends 4,600 4,600
Retained earnings, December 31 $ 156,200 $ 132,000

Required

Calculate the following ratios for 2019 and 2018. Since 2017 numbers are not presented do not use averages when calculating the ratios for 2018. Instead, use the number presented on the 2018 balance sheet.

Working capital.

Current ratio. (Round your answers to 2 decimal places.)

Quick ratio. (Round your answers to 2 decimal places.)

Receivables turnover (beginning receivables at January 1, 2018, were $47,000). (Round your answers to 2 decimal places.)

Average days to collect accounts receivable. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.)

Inventory turnover (beginning inventory at January 1, 2018, was $140,000). (Round your answers to 2 decimal places.)

Number of days to sell inventory. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.)

Debt to assets ratio. (Round your answers to the nearest whole percent.)

Debt to equity ratio. (Round your answers to 2 decimal places.)

Number of times interest was earned. (Round your answers to 2 decimal places.)

Plant assets to long-term debt. (Round your answers to 2 decimal places.)

Net margin. (Round your answers to 2 decimal places.)

Turnover of assets. (Round your answers to 2 decimal places.)

Return on investment. (Round your answers to 2 decimal places.)

Return on equity. (Round your answers to 2 decimal places.)

Earnings per share. (Round your answers to 2 decimal places.)

Book value per share of common stock. (Round your answers to 2 decimal places.)

Price-earnings ratio (market price per share: 2018, $11.75; 2019, $12.50). (Round your intermediate calculations and final answer to 2 decimal places.)

Dividend yield on common stock. (Round your answers to 2 decimal places.)

In: Accounting

Financial statements for Allendale Company follow: ALLENDALE COMPANY Balance Sheets As of December 31 2019 2018...

Financial statements for Allendale Company follow:

ALLENDALE COMPANY
Balance Sheets
As of December 31
2019 2018
Assets
Current assets
Cash $ 40,000 $ 36,000
Marketable securities 20,000 6,000
Accounts receivable (net) 54,000 46,000
Inventories 135,000 143,000
Prepaid items 25,000 10,000
Total current assets 274,000 241,000
Investments 27,000 20,000
Plant (net) 270,000 255,000
Land 29,000 24,000
Total assets $ 600,000 $ 540,000
Liabilities and Stockholders’ Equity
Liabilities
Current liabilities
Notes payable $ 17,000 $ 6,000
Accounts payable 113,800 100,000
Salaries payable 21,000 15,000
Total current liabilities 151,800 121,000
Noncurrent liabilities
Bonds payable 100,000 100,000
Other 32,000 27,000
Total noncurrent liabilities 132,000 127,000
Total liabilities 283,800 248,000
Stockholders’ equity
Preferred stock, (par value $10, 4% cumulative, non-participating; 8,000 shares authorized and issued) 80,000 80,000
Common stock (no par; 50,000 shares authorized; 10,000 shares issued) 80,000 80,000
Retained earnings 156,200 132,000
Total stockholders’ equity 316,200 292,000
Total liabilities and stockholders’ equity $ 600,000 $ 540,000
ALLENDALE COMPANY
Statements of Income and Retained Earnings
For the Years Ended December 31
2019 2018
Revenues
Sales (net) $ 230,000 $ 210,000
Other revenues 8,000 5,000
Total revenues 238,000 215,000
Expenses
Cost of goods sold 120,000 103,000
Selling, general, and administrative 55,000 50,000
Interest expense 8,000 7,200
Income tax expense 23,000 22,000
Total expenses 206,000 182,200
Net earnings (net income) 32,000 32,800
Retained earnings, January 1 132,000 107,000
Less: Preferred stock dividends 3,200 3,200
Common stock dividends 4,600 4,600
Retained earnings, December 31 $ 156,200 $ 132,000

Required

Calculate the following ratios for 2019 and 2018. Since 2017 numbers are not presented do not use averages when calculating the ratios for 2018. Instead, use the number presented on the 2018 balance sheet.

Working capital.

Current ratio. (Round your answers to 2 decimal places.)

Quick ratio. (Round your answers to 2 decimal places.)

Receivables turnover (beginning receivables at January 1, 2018, were $47,000). (Round your answers to 2 decimal places.)

Average days to collect accounts receivable. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.)

Inventory turnover (beginning inventory at January 1, 2018, was $140,000). (Round your answers to 2 decimal places.)

Number of days to sell inventory. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.)

Debt to assets ratio. (Round your answers to the nearest whole percent.)

Debt to equity ratio. (Round your answers to 2 decimal places.)

Number of times interest was earned. (Round your answers to 2 decimal places.)

Plant assets to long-term debt. (Round your answers to 2 decimal places.)

Net margin. (Round your answers to 2 decimal places.)

Turnover of assets. (Round your answers to 2 decimal places.)

Return on investment. (Round your answers to 2 decimal places.)

Return on equity. (Round your answers to 2 decimal places.)

Earnings per share. (Round your answers to 2 decimal places.)

Book value per share of common stock. (Round your answers to 2 decimal places.)

Price-earnings ratio (market price per share: 2018, $11.75; 2019, $12.50). (Round your intermediate calculations and final answer to 2 decimal places.)

Dividend yield on common stock. (Round your answers to 2 decimal places.)

In: Accounting

Financial statements for Allendale Company follow: ALLENDALE COMPANY Balance Sheets As of December 31 2019 2018...

Financial statements for Allendale Company follow: ALLENDALE COMPANY Balance Sheets As of December 31 2019 2018 Assets Current assets Cash $ 40,000 $ 36,000 Marketable securities 20,000 6,000 Accounts receivable (net) 54,000 46,000 Inventories 135,000 143,000 Prepaid items 25,000 10,000 Total current assets 274,000 241,000 Investments 27,000 20,000 Plant (net) 270,000 255,000 Land 29,000 24,000 Total assets $ 600,000 $ 540,000 Liabilities and Stockholders’ Equity Liabilities Current liabilities Notes payable $ 17,000 $ 6,000 Accounts payable 113,800 100,000 Salaries payable 21,000 15,000 Total current liabilities 151,800 121,000 Noncurrent liabilities Bonds payable 100,000 100,000 Other 32,000 27,000 Total noncurrent liabilities 132,000 127,000 Total liabilities 283,800 248,000 Stockholders’ equity Preferred stock, (par value $10, 4% cumulative, non-participating; 8,000 shares authorized and issued) 80,000 80,000 Common stock (no par; 50,000 shares authorized; 10,000 shares issued) 80,000 80,000 Retained earnings 156,200 132,000 Total stockholders’ equity 316,200 292,000 Total liabilities and stockholders’ equity $ 600,000 $ 540,000 ALLENDALE COMPANY Statements of Income and Retained Earnings For the Years Ended December 31 2019 2018 Revenues Sales (net) $ 230,000 $ 210,000 Other revenues 8,000 5,000 Total revenues 238,000 215,000 Expenses Cost of goods sold 120,000 103,000 Selling, general, and administrative 55,000 50,000 Interest expense 8,000 7,200 Income tax expense 23,000 22,000 Total expenses 206,000 182,200 Net earnings (net income) 32,000 32,800 Retained earnings, January 1 132,000 107,000 Less: Preferred stock dividends 3,200 3,200 Common stock dividends 4,600 4,600 Retained earnings, December 31 $ 156,200 $ 132,000 Required Calculate the following ratios for 2019 and 2018. Since 2017 numbers are not presented do not use averages when calculating the ratios for 2018. Instead, use the number presented on the 2018 balance sheet. Working capital. Current ratio. (Round your answers to 2 decimal places.) Quick ratio. (Round your answers to 2 decimal places.) Receivables turnover (beginning receivables at January 1, 2018, were $47,000). (Round your answers to 2 decimal places.) Average days to collect accounts receivable. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.) Inventory turnover (beginning inventory at January 1, 2018, was $140,000). (Round your answers to 2 decimal places.) Number of days to sell inventory. (Round your intermediate calculations to 2 decimal places and your final answers to the nearest whole number.) Debt to assets ratio. (Round your answers to the nearest whole percent.) Debt to equity ratio. (Round your answers to 2 decimal places.) Number of times interest was earned. (Round your answers to 2 decimal places.) Plant assets to long-term debt. (Round your answers to 2 decimal places.) Net margin. (Round your answers to 2 decimal places.) Turnover of assets. (Round your answers to 2 decimal places.) Return on investment. (Round your answers to 2 decimal places.) Return on equity. (Round your answers to 2 decimal places.) Earnings per share. (Round your answers to 2 decimal places.) Book value per share of common stock. (Round your answers to 2 decimal places.) Price-earnings ratio (market price per share: 2018, $11.75; 2019, $12.50). (Round your intermediate calculations and final answer to 2 decimal places.) Dividend yield on common stock. (Round your answers to 2 decimal places.)

In: Accounting

Throughout the semester, you have learned about several theories and practices of psychology across many different...

Throughout the semester, you have learned about several theories and practices of psychology across many different areas. This assignment will give you an opportunity to apply some of those 1,500-word concepts, theoretical perspectives, and empirical findings. In completing this five, you will hone your critical thinking skills, recognizing and applying psychological principles, and communicating your understanding of individual, community, and organizational life experiences to a general audience. Task: For this assignment, you will write a paper based on a film or book that you will explore through the application of psychological theory and research. Step 1: Select a film or book of interest. For example, you might select a movie or book in which the main character suffers from a psychological disorder or is merely trying to cope with the everyday stress of life. Be creative. For instance, choose "Snow White" and talk about the Evil Queen's Narcissistic Personality Disorder or choose "Cat in The Hat" and talk about the Cat's "Borderline Personality Disorder" or something like that (please do not use either of those suggestions specifically). Do not choose something obvious, but be creative and thoughtful. Step 2: Review your course resources to identify three specific psychological theories or principles that can be applied to the analysis of the book or film. You might discuss defense mechanisms or refer to developmental stages in the person's life that might have been important, or consider the effects of abuse, alcoholism and addiction, etc. You can approach the subject matter from different perspectives—psychoanalytical, biological, behavioral, cognitive, and/or sociocultural. You can discuss the role emotion, memory, or motivation plays in the character's development, or the importance of the environment, and influences such as racism and sexism. Step 3: Search the library database using relevant keywords for your topic for at least one peer-reviewed article to support your ideas. Psychology cuts across many disciplines so feel free to explore journals in other areas such as business, education, health, and criminal justice. Tip: When conducting your search in the library include a theory or principle plus a topic (i.e. Body Dysmorphic Disorder and Adolescents). Use alternative key words to improve your chances of finding relevant articles and create a specific search statement to help narrow your results." The example might be something like "("Body Dysmorphic Disorder" OR BDD) AND (adolescent* OR teen*)"

In: Psychology

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