Questions
File input.txt contains 100,000 numbers separated by new line. Do the following: Write a C++ program...

  1. File input.txt contains 100,000 numbers separated by new line. Do the following:
    1. Write a C++ program to compute the summation of these 100,000 numbers using single thread.
    2. Write a C++ program to compute the summation of these 100,000 numbers using 10 threads, meaning each thread compute 10,000 summations and the main thread sum the result of the 10 threads.
    3. Using the time syscall to compare the time spent for 1.1 and 1.2

Turn Ins:

Source code of two programs and a short report on to answer the following question:

  1. What is the run time for 1.1?
  2. What is the run time for 1.2?
  3. Is there a run time difference and why?

input.txt looks like below

55
59
56
23
93
9
39
76
27
81
46
99
35
11
93
43
10
22
29
89
8
10
11
86
48
34
39
3
54
4
76
2
35
52
58
92
75
15
48
51
29
81
96
25
46
90
67
40
55
67
44
76
3
48
31
61
48
9
64
68
78
4
17
26
63
64
92
11
58
54
71
51
11
16
27
76
91
8
77
35
12
84
87
93
71
14
5
36
16
35
30
47
85
81
78
34

In: Computer Science

Nowadays, movies can be rented from a vending machine located at the entrance to many stores.  Suppose...

Nowadays, movies can be rented from a vending machine located at the entrance to many stores.  Suppose that it is now Friday evening at 8pm and a certain machine within a certain store has six copiesof the movie “Twilight” available for rent.  The machine will not be visited by the owner until Sunday afternoon at noon (which is 40hrs later), at which time returned movies will be restocked.

Suppose that customers wanting to rent “Twilight” arrive at this rental machine at a rate of 1 every 5 hours.

LetW= the time (in hours) until the next “Twilight” renter arrives at the machine.

Name the distribution of Wand identify the parameter.

Distribution name:  ___________________

Parameter value:  ___________________

What is the chance the next “Twilight” renter arrives sometime on Saturday?

      Thus, we seek the P( ___ < W< ___ ) which equals ________________?

LetX= the number of renters wanting “Twilight” that come to the

vending machine over the weekend (Fri 8pm until Sunday noon).

Name the distribution of Xand identify the parameter.

Distribution name:  ___________________

Parameter value:  ___________________

What is the probability that exactly 4 copies of “Twilight” are rented over

       the weekend?  Thus, we seek the P(X= 4) which equals ________________?

What is the probability that all copies of “Twilight” are rented over the

      weekend?  Thus, we seek  P( X __  __ ) which equals ________________?

In: Math

Using C language, and describe the algorithm design All the sample is correct Q3 Problem description...

Using C language, and describe the algorithm design
All the sample is correct

  • Q3 Problem description

Tim was born in a leap year, so he would like to know when he could have his birthday party. Could you tell him? Given a positive integers Y indicating the starting year, and a positive integer N, your task is to tell the N-th leap year from year Y. Note: if year Y is a leap year, then the 1st leap year is year Y.

  • Input & output requirements

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains two positive integers Y and N(1<=N<=10000). For each test case, you should output the Nth leap year from year Y.

  • Sample input

3

2005 25

1855 12

2004 10000

  • Sample output

2108

1904

43236

In: Computer Science

Transformational Leadership - List one organizational situation when this style will be Inappropriate/destructive?

Transformational Leadership - List one organizational situation when this style will be Inappropriate/destructive?

In: Operations Management

Effective communication among teams is often understood within the framework of social exchange theory. Describe this...

Effective communication among teams is often understood within the framework of social exchange theory. Describe this theory, and list two key characteristics in a social exchange interaction.

In: Psychology

Compare the structure of xylenol orange to phenolphthalein. Do some research to determine why phenolphthalein changes...

Compare the structure of xylenol orange to phenolphthalein. Do some research to determine why phenolphthalein changes color under acidic or basic conditions. Based on the chemistry of phenolphthalein, explain why xylenol orange is a different color in the presence and absence of zinc ions. It is useful to note that the xylenol orange-zinc complex that is red must abosorb light around 500-550 nm while the free xylenol orange molecule is yellow, so must absorb light around 400-450 nm. This general chemistry II. Please answer well!

In: Chemistry

A psychologist wants to determine if aging has an impact on depression. It is known that...

A psychologist wants to determine if aging has an impact on depression. It is known that the general population scores a 41 on a standardized depression test where a higher score indicates more depression. The psychologist obtains a sample of individuals that are all over 67 years old. What can the psychologist conclude with an α of 0.01? The data are below.


id
depression
score
2
6
8
12
3
4
11
19
5
6
76.1
44.9
72.5
42.2
30.1
67.6
51.3
36.5
54.3
47.2


a) What is the appropriate test statistic?
---Select--- na z-test One-Sample t-test Independent-Samples t-test Related-Samples t-test

b)
Population:
---Select--- aging standardized depression test depression elderly general population
Sample:
---Select--- aging standardized depression test depression elderly general population

c) Compute the appropriate test statistic(s) to make a decision about H0.
(Hint: Make sure to write down the null and alternative hypotheses to help solve the problem.)
p-value =  ; Decision:  ---Select--- Reject H0 Fail to reject H0

d) Using the SPSS results, compute the corresponding effect size(s) and indicate magnitude(s).
If not appropriate, input and/or select "na" below.
d =  ;   ---Select--- na trivial effect small effect medium effect large effect
r2 =  ;   ---Select--- na trivial effect small effect medium effect large effect

e) Make an interpretation based on the results.

The elderly are significantly more depressed than the population.

The elderly are significantly less depressed than the population.    

The elderly did not significantly differ on depression than the population

In: Math

It seems to be very common sense to not have HR practices that are competing with...

It seems to be very common sense to not have HR practices that are competing with one another. Why does this happen and what would be your recommendations to managers to try to avoid this scenario?

Provide examples from your work experiences in which incongruent HR practices existed. What was the impact on performance, motivation, and turnover?

In: Operations Management

P3-6 (Algo) Analyzing the Effects of Transactions Using T-Accounts, Preparing an Income Statement, and Evaluating the...

P3-6 (Algo) Analyzing the Effects of Transactions Using T-Accounts, Preparing an Income Statement, and Evaluating the Net Profit Margin Ratio LO3-4, 3-5, 3-6

[The following information applies to the questions displayed below.]

Following are account balances (in millions of dollars) from a recent StateEx annual report, followed by several typical transactions. Assume that the following are account balances on May 31 (end of the prior fiscal year):

Account Balance Account Balance
Property and equipment (net) $ 18,694 Receivables $ 2,749
Retained earnings 14,406 Other current assets 1,119
Accounts payable 1,737 Cash 1,364
Prepaid expenses 348 Spare parts, supplies, and fuel 878
Accrued expenses payable 2,550 Other noncurrent liabilities 4,010
Long-term notes payable 1,970 Other current liabilities 2,419
Other noncurrent assets 3,272 Additional Paid-in Capital 1,327
Common stock ($0.10 par value) 5

These accounts are not necessarily in good order and have normal debit or credit balances. Assume the following transactions (in millions, except for par value) occurred the next fiscal year beginning June 1 (the current year):

  1. Provided delivery service to customers, who paid $13,390 in cash and owed $41,504 on account.
  2. Purchased new equipment costing $3,914; signed a long-term note.
  3. Paid $12,664 cash to rent equipment and aircraft, with $6,736 for rent this year and the rest for rent next year.
  4. Spent $1,344 cash to repair facilities and equipment during the year.
  5. Collected $38,685 from customers on account.
  6. Repaid $390 on a long-term note (ignore interest).
  7. Issued 260 million additional shares of $0.10 par value stock for $40 (that’s $40 million).
  8. Paid employees $15,276 for work during the year.
  9. Purchased spare parts, supplies, and fuel for the aircraft and equipment for $13,764 cash.
  10. Used $7,650 in spare parts, supplies, and fuel for the aircraft and equipment during the year.
  11. Paid $1,264 on accounts payable.
  12. Ordered $136 in spare parts and supplies.

P3-6 Part 2

2. Prepare T-accounts for the current year from the preceding list; enter the ending balances from May 31 as the respective beginning balances for June 1 of the current year. For each transaction, record the current year's transaction effects in the T-accounts. Label each using the letter of the transaction. (Enter your answers in millions, not in dollars.)

In: Accounting

What are Robert J. Sternberg's (in "Construct Validation of a Triangular Love Scale") three components of...

What are Robert J. Sternberg's (in "Construct Validation of a Triangular Love Scale") three components of intimate relationships? Is it necessary for all three to be present in an intimate relationship? How do relationships that vary on these components differ from each other?

In: Psychology

3. What does mystery2 compute on an input n? Please explain how you found this. thanks!...

3. What does mystery2 compute on an input n? Please explain how you found this. thanks!

public static int problem1(int n) {

int begin = 0;

int end = n+1;

while (begin+1 < end){

int mid = (begin+end)/2;

if(112*mid <= n){

begin = mid;

}

else{

end = mid;

}

}

return begin;

}

In: Computer Science

essay on test anxiety for foundation students. Symptoms

essay on test anxiety for foundation students. Symptoms

In: Psychology

What does the following PHP code accomplish? 1. function validateInput ( $data ) { 2. $data...

What does the following PHP code accomplish?

1. function validateInput ( $data ) {

2. $data = trim ( $data );

3. $data = stripslashes ( $data );

4. $data = htmlspecialchars ($data , ENT_QUOTES | ENT_HTML5 ,'UTF -8 ');

5. return $data ;

6.   }

In: Computer Science

GAMEMODE(gamemode_id, gamemode_name, gamemode_type) GAME(game_id, game_time, game_results, game_date, gamemode_id) ACTIVEPLAYER(player_online_status, game_id, hero_level) PLAYERHERO(hero_level, hero_id, player_id) HERO(hero_id, hero_role,...

GAMEMODE(gamemode_id, gamemode_name, gamemode_type)
GAME(game_id, game_time, game_results, game_date, gamemode_id)

ACTIVEPLAYER(player_online_status, game_id, hero_level)
PLAYERHERO(hero_level, hero_id, player_id)
HERO(hero_id, hero_role, hero_price, hero_name, hero_speciality)
SKIN(skin_id, skin_price, skin_name, hero_id)

PLAYER(player_email, player_username, player_id)
PLAYER ACCOUNT(player_id,player_username,player_onlinestatus,player_battle_point,player_global_level,player_diamonds)

Normalise this to 3NF

In: Computer Science

ABC drug company has hired you as a consultant to hire the following positions: Production Supervisor...

ABC drug company has hired you as a consultant to hire the following positions:

  1. Production Supervisor (Factory)
  2. Health and Safety Specialist
  3. Financial Analyst
  4. HRIS (Human Resource Information System) Specialist
  5. Corporate Communication Director
  6. Recruiter

ABC wants you to independently develop the job specification (KSAOs) of the jobs, and submit a proposal as how you would like to recruit, screen and then conduct employment testing prior to the final employment interview.

Instruction: for any four job of your choice from the above list and prepare the following:

  1. Develop a job specification (KSAOs) of your picked job.

(if you are not sure about the job description and specification of your picked job, you can do some research in the internet using NOC, O*Net or other available resources. These specifications may vary from student to student. Its ok)

Based on your developed job specification (KSAOs) and course learning (lecture, text, class activities) answer the following:

  1. Propose suitable recruitment sources (not more than 4) explaining the reasons behind your choices.
  1. Propose a screening strategy, outlining each stage of screening and the resources and tools to be used. (Here you need to assume a reasonable volume of applications that you expect to receive)
  1. Propose suitable employment tests for the screened candidates (not more than 4) with justifications and legal implications for using them.
  1. Timing of recruitment plan indicating each stage of your initiatives up-to the completion of employment testing (Here, again, you need to have your estimates of candidates in each stage)

In: Operations Management