Questions
Please answer the following questions. Be sure to support your answers with citations and refernces to...

Please answer the following questions. Be sure to support your answers with citations and refernces to existing scholarly publications.

How do leaders relate to subordinates and colleagues? How do leaders balance the relationship aspects of leadership with the task-oriented aspect of leadership?

Situational leadership is an amalgam of a directive and a supportive dimension. How does a leader determine how much focus to put on either of the two dimensions?

In: Psychology

Lear Corporation has decided to acquire a new equipment at a cost of $698,000. The equipment...

Lear Corporation has decided to acquire a new equipment at a cost of $698,000. The equipment has an expected life of 6 years and will be depreciated using 5-year MACRS with rates of .20, .32, .192, .1152, .1152, and .0576 (note that 5-year MACRS depreciation actually takes place over 6 years). There is no actual salvage value. Riverhawk Financing has offered to lease the equipment to Lear for $135,000 a year for 6 years. Lear has a cost of equity of 11.2 percent, a pre-tax cost of debt of 5.8 percent, and a marginal tax rate of 25 percent. Should Lear lease or buy?

Lear should lease because NPV = $18,028.72

Lear should lease because NPV = $21,209.58

Lear should buy because NPV = $15,763.87

Lear should buy because NPV = $10,933.18

Lear should lease because NPV = $10,805.47

In: Finance

The goodness of fit of a statistical model describes how well it fits a set of...

The goodness of fit of a statistical model describes how well it fits a set of observations. Measures of goodness of fit typically summarize the discrepancy between observed values and the values expected under the model in question.

Such measures may be used in statistical hypothesis testing, for example, to test for normality of residuals, to test whether two samples are drawn from identical distributions, or rather outcome frequencies follow a specified distribution (Pearson's chi-squared test).

In the analysis of variance one of the components in to which the variance is partitioned may be a lack of fit sum of squares. In other words, it tells you if your sample data represents the data you would expect to find in the actual population.

Please in a minimum of 200 words:

What good is this information to us? Why would we need to know something like this?

In: Math

Forrester and Cohen is a small accounting​ firm, managed by Joseph Cohen since the retirement in...

Forrester and Cohen is a small accounting​ firm, managed by Joseph Cohen since the retirement in December of his partner Brad Forrester. Cohen and his 4 CPAs together bill 800 hours per month. When Cohen or another accountant bills more than 160 hours per​ month, he or she gets an additional​ "overtime" pay of ​$61.00 for each of the extra​ hours: This is above and beyond the $5,100 salary each draws during the month.​ (Cohen draws the same base pay as his​ employees.) Cohen strongly discourages any CPA from working​ (billing) more than 230 hours in any given month. The demand for billable hours for the firm over the next 6 months is estimated​ below:

Month:                   Estimate of Billable Hours

Jan.                                         682

Feb.                                         539

Mar.                                        1133

Apr.                                         1331

May                                         726

June                                        638

Cohen has an agreement with​ Forrester, his former​ partner, to help out during the busy tax​ season, up to 230 hours in any given month if​ needed, for an hourly fee of $120. Cohen will not even consider laying off one of his colleagues in the case of a slow economy. He​ could, however, hire another CPA at the same​ salary, as business dictates.

a) Develop an aggregate plan for the​ 6-month period ​(enter your responses as whole​ numbers). Use regular​ time, then​ overtime, then​ Forrester, and then hire additional CPAs if needed.

​Note: For the CPA​ column, only include​ Cohen, his 4 CPAs, and any new CPAs he may hire in your total. Do NOT include Forrester.

Month

Est. of Billable hours

CPAs

Reg. time billable hours

Reg. time cost

Overtime hours

Overtime cost

Forrester hours

Forrester cost

Jan

682

?

?

?

?

?

?

?

Feb

539

?

?

?

?

?

?

?

Mar

1133

?

?

?

?

?

?

?

Apr

1331

?

?

?

?

?

?

?

May

726

?

?

?

?

?

?

?

Jun

638

?

?

?

?

?

?

?

b) Compute the cost of​ Cohen's plan of using overtime and Forrester.

Total cost= ?

In: Operations Management

SQL is our language for relational databases - do you think it's an adequate "language" for...

SQL is our language for relational databases - do you think it's an adequate "language" for database creation and manipulation?

Please help answer this.

In: Computer Science

The WACC is a weighted average of the costs of debt, preferred stock, and common equity....

The WACC is a weighted average of the costs of debt, preferred stock, and common equity. Would the WACC be different if the equity for the coming year came solely in the form of retained earnings versus equity from the sale of new common stock? Would the calculated WACC depend in any way on the size of the capital budget? How might dividend policy affect the WACC? Please explain.

In: Finance

The below test includes 10 questions, randomly selected from a large inventory. Most questions will be...

The below test includes 10 questions, randomly selected from a large inventory. Most questions will be different each time you take the test,

You must answer at least 9 out of 10 questions correctly to receive your Certificate.

You have 40 minutes to complete each test, and you must answer all 10 questions in order to to see your results. If you do not pass this test in 40 minutes,

If the student version contains BOTH word-for-word and paraphrasing plagiarism, you should select word-for-word.

If you need help, see this document which provides criteria for determining plagiarism that are used in this test.

Privacy notice: If you pass a test, unique information displayed on your Certificate is also stored in a secure location.

Item 1

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

APT was compared with numerous extant methodologies, including the linear models approach and event history analysis. The fundamental difference between APT and these other approaches is that no particular mathematical model is assumed in APT. In APT a model is viewed simply as a temporal pattern, whereas in most other approaches parameters of a mathematical model are estimated from data in which variables are measured separately. Moreover, in APT probabilities of temporal patterns are estimated by relative frequency and duration.

References:
Frick, T. (1990). Analysis of Patterns in Time (APT): A Method of Recording and Quantifying Temporal Relations in Education. American Educational Research Journal, 27(1), 180-204.

The major difference between Analysis of Patterns in Time and linear statistical models is that APT does not assume any specific mathematical model. Linear models attempt to find statistical relations between variables that have been measured separately. In APT, temporal patterns indicate relationships. Those patterns are counted in order to estimate their likelihoods.

References:
Frick, T. (1990). Analysis of Patterns in Time (APT): A Method of Recording and Quantifying Temporal Relations in Education. American Educational Research Journal, 27(1), 180-204.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 2

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

There is a design methodology called rapid prototyping, which has been used successfully in software engineering. Given similarities between software design and instructional design, we argue that rapid prototyping is a viable method for instructional design, especially for computer-based instruction.

References:
Tripp, S. D., & Bichelmeyer, B. A. (1990). Rapid prototyping: An alternative instructional design strategy. Educational Technology Research and Development, 38(1), 31-44.

Rapid prototyping could be an advantageous methodology for developing innovative computer-based instruction (Tripp & Bichelmeyer, 1990).

References:
Tripp, S. D., & Bichelmeyer, B. A. (1990). Rapid prototyping: An alternative instructional design strategy. Educational Technology Research and Development, 38(1), 31-44.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 3

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

The philosophical position known as constructivismviews knowledge as a human construction. The various perspectives within constructivism are based on the premise that knowledge is not part of an objective, external reality that is separate from the individual. Instead, human knowledge, whether the bodies of content in public disciplines (such as mathematics or sociology) or knowledge of the individual learner, is a human construction.

References:
Gredler, M. E. (2001). Learning and instruction: Theory into practice (4th Ed.). Upper Saddle River, NJ: Prentice-Hall.

Does knowledge exist outside of, or separate from, the individual who knows? Constructivists argue that human knowledge, such as what is known in the fields of mathematics or sociology, as well as knowledge about learning itself, is a human construction (Gredler, 2001).



References:
Gredler, M. E. (2001). Learning and instruction: Theory into practice (4th Ed.). Upper Saddle River, NJ: Prentice-Hall.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 4

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

To summarize, the elaboration model of instruction starts by presenting knowledge at a very general or simplified level in the form of a special kind of overview. Then it proceeds toadd detail or complexity in "layers" across the entire breadth of the content of the course (or curriculum), one layer at a time, until the desired level of detail or complexity is reached.

References:
Reigeluth, C. M. (1999). The elaboration theory: Guidance for scope and sequence decisions. In C. M. Reigeluth (Ed.), Instructional design theories and models: A new paradigm of instructional theory (Vol. II, pp. 425-453). Hillsdale, NJ: Lawrence Erlbaum.

They soon switched to a model based on the elaboration theory (Reigeluth, 1999). Using this approach, the game would begin with a level that offered the simplest version of the whole task (the epitome); subsequent levels would become increasingly more complex--an approach common to videogames--with opportunities for review and synthesis.

References:
Reigeluth, C. M. (1999). The elaboration theory: Guidance for scope and sequence decisions. In C. M. Reigeluth (Ed.), Instructional design theories and models: A new paradigm of instructional theory (Vol. II, pp. 425-453). Hillsdale, NJ: Lawrence Erlbaum.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 5

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

In a complex task such as creating a website for learning, instructors may want to support the generation of multiple solutions in learners' peer feedback. Anonymity may create a social context where learners feel freer to express varied ideas, and make the task of giving feedback less inhibited. However, teachers need to know just how anonymity impacts the learning dynamic in order to make informed choices about when anonymous configurations are appropriate in peer feedback.

References:
Howard, C. D., Barrett, A. F., & Frick, T. W. (2010). Anonymity to promote peer feedback: Pre-service teachers' comments in asynchronous computer-mediated communication. Journal of Educational Computing Research, 43(1), 89-112.

Increased availability of technology in my classroom makes it easier for peer feedback activities to be conducted anonymously which "may create a social context where learners feel freer to express varied ideas, and make the task of giving feedback less inhibited" (Howard, Barrett, & Frick, 2010, p. 90). However, I worry that my students may be overly harsh if they don't have to stand by their comments.

References:
Howard, C. D., Barrett, A. F., & Frick, T. W. (2010). Anonymity to promote peer feedback: Pre-service teachers' comments in asynchronous computer-mediated communication. Journal of Educational Computing Research, 43(1), 89-112.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 6

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

While solitary negative reactions or unjustified suggestions for change have the potential to dissipate discourse rather than build it, the pattern analysis shows that the anonymous condition seemed to provide a safe explorative space for learners to try out more reasons for their multiple solutions. Teachers will rarely give anonymous feedback, but the experience of giving anonymous feedback may open a social space where learners can try out the reasons for their suggestions.

References:
Howard, C. D., Barrett, A. F., & Frick, T. W. (2010). Anonymity to promote peer feedback: Pre-service teachers' comments in asynchronous computer-mediated communication. Journal of Educational Computing Research, 43(1), 89-112.

In their study of anonymity in an online peer feedback activity, the authors found that, under conditions of anonymity, learners seemed more inclined to provide reasons to back up their suggestions (Howard, Barrett, & Frick, 2010). Getting both suggestions and the reasons for the suggestions would be welcome in feedback I receive from peers or my instructors. Seeing the reasons would help me know that the suggestions have been thought through (even if I don't always agree with them).

References:
Howard, C. D., Barrett, A. F., & Frick, T. W. (2010). Anonymity to promote peer feedback: Pre-service teachers' comments in asynchronous computer-mediated communication. Journal of Educational Computing Research, 43(1), 89-112.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 7

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

First, the potential of digital games is discussed using the tutor/tool/tutee framework proposed by Taylor (1980). Second, the potential of digital games to enhance learning by connecting game worlds and real worlds is stated. Third, the possibility of digital games to facilitate collaborative problem-solving is addressed. Fourth, the capability of digital games to provide an affective environment for science learning is suggested. Last, the potential of using digital games to promote science learning for younger students is indicated.

References:
Li, M. C., & Tsai, C. C. (2013). Game-Based Learning in Science Education: A Review of Relevant Research. Journal of Science Education and Technology, 1-22.

There are five advantages of using games in science learning stated in the literature. Games can be used as tools; make connections between virtual worlds and the real world; promote collaborative problem solving; provide affective and safe environments; and encourage younger students for science learning.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 8

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

Suppose you study a group of successful companies and you find that they emphasize customer focus, or quality improvement, or empowerment; how do you know that you haven't merely discovered the management practice equivalent of having buildings? How do you know that you've discovered something that distinguishes the successful companies from other companies? You don't know. You can't know--not unless you have a control set, a comparison group.

References:
Collins, J. C., & Porras, J. I. (2002). Built to last: Successful habits of visionary companies. New York, NY: Harper Paperbacks.

Attributes of rigorous research can be shared across subjects of study. For example, Collins and Porras (2002) highlight the importance of having a control group when comparing companies in any effort to identify what specific company characteristics are able to distinguish the successful from the ordinary.

References:
Collins, J. C., & Porras, J. I. (2002). Built to last: Successful habits of visionary companies. New York, NY: Harper Paperbacks.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 9

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

The game-based laboratory was vastly different from their expectations and experiences of a typical laboratory; this might have resulted in the students being disconnected from the learning aspect of the game. However, the students' comments suggested that their discomfort with the video game was due to the fact that they did not perceive that a video game could really be educational. The game became a disruption to their traditional ways of science learning and interfered with how they perceived the learning experience. This perspective is potentially problematic as it suggests that pedagogical disruptions such as video games that are designed to be powerful learning tools simply may not work for all students.

References:
Anderson, J. L., & Barnett, M. (2013). Learning Physics with Digital Game Simulations in Middle School Science. Journal of Science Education and Technology, 1-13.

Since a game-based laboratory provides a virtual environment with different experiences than in a real lab, students may fail to connect these virtual experiences to real lab experiences. Student and teacher beliefs that games are entertainment tools, not educational tools, may minimize the potential of video games intended to help students learn science.

References:
Anderson, J. L., & Barnett, M. (2013). Learning Physics with Digital Game Simulations in Middle School Science. Journal of Science Education and Technology, 1-13.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

Hints

Item 10

In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button.

Original Source Material

Student Version

But what are reasonable outcomes of the influence of global processes on education?While the question of how global processes influence all aspects of education (and who controls these forces) is multidimensional and not completely testable, there appear to be some theories of globalization as it relates to education that can be empirically examined.

References:
Rutkowski, L., & Rutkowski, D. (2009). Trends in TIMSS responses over time: Evidence of global forces in education? Educational Research and Evaluation, 15(2), 137-152.

Rutkowski and Rutkowski (2009) ask "what are reasonable outcomes of the influence of global processes on education?" (p. 138). This question is not entirely testable and has multiple dimensions but theories of globalization's impact on education exist and provide means of empirical analysis.

References:
Rutkowski, L., & Rutkowski, D. (2009). Trends in TIMSS responses over time: Evidence of global forces in education? Educational Research and Evaluation, 15(2), 137-152.

Which of the following is true for the Student Version above?

Word-for-Word plagiarism

Paraphrasing plagiarism

This is not plagiarism

In: Psychology

Walsh Company manufactures and sells one product. The following information pertains to each of the company’s...

Walsh Company manufactures and sells one product. The following information pertains to each of the company’s first two years of operations:

Variable costs per unit:

Manufacturing:

Direct materials $ 29

Direct labor $ 11

Variable manufacturing overhead $ 3

Variable selling and administrative $ 2

Fixed costs per year:

Fixed manufacturing overhead $ 400,000

Fixed selling and administrative expenses $ 90,000

During its first year of operations, Walsh produced 50,000 units and sold 40,000 units. During its second year of operations, it produced 40,000 units and sold 50,000 units. The selling price of the company’s product is $82 per unit.

Required:

1. Assume the company uses variable costing: a. Compute the unit product cost for Year 1 and Year 2.

b. Prepare an income statement for Year 1 and Year 2.

2. Assume the company uses absorption costing: a. Compute the unit product cost for Year 1 and Year 2.

b. Prepare an income statement for Year 1 and Year 2.

3. Reconcile the difference between variable costing and absorption costing net operating income in Year 1.

In: Accounting

Using double precision floating point arithmetic, write a( MIPS )program that will convert input temperatures in...

Using double precision floating point arithmetic, write a( MIPS )program that will convert input temperatures in Fahrenheit to Celsius. The program should prompt the user for a temperature in Fahrenheit and then print the corresponding temperature in Celsius. The formula for the conversion is:

C = 5/9 * (F – 32)

In: Computer Science

Write the following easy Python functions: 1) Write the function named roundDollars(). The function has one...

Write the following easy Python functions:

1) Write the function named roundDollars(). The function has one input, a String named amountStr which consists of a dollar-formatted amount, such as "$ 1,256.86". The returned value is an int representing the number of rounded "dollars" in the amount, (1257 in the sample shown here). You will need to scrub, format and parse the input, then use arithmetic to determine how many rounded dollars the amount contains.

roundDollars("$ 1,256.86") → 1257

roundDollars("$ 0.42") → 0

roundDollars("$375.00") → 3752

2) Write the function named lineItem() that formats an item on a receipt. The function has two parameters, a String description and a double price. Return a formatted string where description is left-aligned in a column 15 wide and the price is right-aligned in a column 10 wide with two decimals. Thousands should be separated by commas but there should be no dollar sign. For example:

lineItem("Toaster", 24) → "Toaster 24.00"

lineItem("Orange Juice", 3.59) → "Orange Juice 3.59"

lineItem("Carbon Fiber Bike", 1129) → "Carbon Fiber Bi 1,129.00"

3) Write the function named change() that returns a list of coins, formatted in String form, returned from a purchase. The function has two parameters, the amountTendered and the purchasePrice, both doubles. Your function calculates the change due, and then formats the number of dollars, quarters (.25), dimes (.10), nickels (.05) and pennies (.01) due. Each number will be an int and it will be formatted in a column 5 wide. (In other words, your output will have exactly 5 columns and your returned String will be 25 characters long.

change(20, 3.89) → ' 16 0 1 0 1'

change(100, 38.12) → ' 61 3 1 0 3'

change(.25,.20) → ' 0 0 0 1 0'

In: Computer Science

You are the Senior Systems Administrator for a community based charity. Your charity is involved in...

You are the Senior Systems Administrator for a community based charity. Your charity is involved

in locating and providing accommodation, mental health services, training and support services to

disadvantaged people in the community.

Your charity currently runs a small data centre that has some 50 x86 64 bit servers running mainly

Windows Server 2008 R2 for desktop services, database and file services. It also has about 10 Red

Hat Enterprise Linux 5 servers for public facing Web pages, services and support.

Your charity is considering joining a community cloud provided by a public cloud vendor in order

to provide a number of applications to all 500 support staff and administrative users. The

community cloud would also be used to store the charity’s 200TB of data. This data contains a

considerable amount of confidential information about the people to whom the charity provides

services. A small number of the charity’s applications are mission critical and the data that those

applications use is both confidential and time sensitive.

The cloud vendor has made a presentation to management that indicates that operational costs

will drop dramatically if the cloud model is adopted. You are asked to assess whether this model is

in the best interests of the business.

Describe the steps that you would take to do a Risk Management assessment of this proposal.

20. Ramgovind, Eloff and Smith proposed in their 2010 paper that an information security analysis

should include the requirements of Identification and authorisation, authorisation,

confidentiality, Integrity, non-repudiation and availability. Discuss whether these

requirements are adequate for a proper security assessment for a proposed move to an IaaS

model for the charity.

21. A potential migration to the Cloud raises many issues around Governance. Discuss the

governance issues that you see arising from a migration of on-premise servers to an IaaS

model.

22. The charity’s board has proposed a move to migrate its servers to an IaaS model. Discuss the

methods that you would propose to the board to assess the SLA of the Cloud Provider. (10

marks)

23. The board has decided, as an initial step, to move the office automation and database servers

to the AWS cloud in order to begin the migration process, and test their strategy. Describe ten

steps that you would include in the plan to migrate these services.

In: Computer Science

C++please add menu choice on main.cpp with these function below. output : Hello! let's play a...

C++please add menu choice on main.cpp with these function below.

output :

Hello! let's play a game

a.Exit

b.Set Player's Names

c.Play in 2 Player Mode

d.Play in 1 Player Mode (vs. Computer)


//////////////////HEADER //////////////////////

#ifndef MYHEADER_H_
#define MYHEADER_H_
#include<iostream>
#include<iomanip>
#include<cstdlib>

using namespace std;

const int NUM_ROWS = 3;
const int NUM_COLS = 3;

int sum;

void OutputInstruct()
{
   cout << "\nPlay the game\n"<<endl;
}

/******************************************************************************
* InitBoard
* This function initializes each spot in the board to a space ' '.
* RETURNS: Board initialized with all spaces
*****************************************************************************/

void InitBoard(char board[][3]) // tic tac toe board – OUT
{
   for(int i = 0; i <= NUM_ROWS; i++)
       for(int j = 0; j <= 3; j++)
           board[i][j] = ' ';
}

/******************************************************************************
* DisplayBoard
* This function outputs the tic tac toe board including the tokens
* played in the proper format (as described below).

   1        2        3
1[1][1]. [1][2]. [1][3]
2[2][1]. [2][2]. [2][3]
3[3][1]. [3][2]. [3][3]

* RETURNS: nothing
* Outputs the current state of the board
*****************************************************************************/

void DisplayBoard(const char board[][3]) // tic tac toe board
{
   cout << setw(10) << "1" << setw(8) << "2" << setw(9) << "3\n";
   for (int i=0; i < 3; i++)
   {
       cout << setw(7)<< "[" << i+1 << "][1] | " << "[" << i+1;
       cout << "][2] | " << "[" << i+1 << "][3]" << endl;
       cout << setw(14)<< "|" << setw(9) << "|" << endl;

       for (int j = 0; j < 3; j++)
       {
           switch(j)
           {
               case 0: cout << i + 1 << setw(9) << board[i][j];
               cout << setw(4) << "|";
               break;

               case 1: cout << setw(4) << board[i][j];
               cout << setw(5) << "|";
               break;

               case 2: cout << setw(4) << board[i][j] << endl;
               break;

               default: cout <<"ERROR!\n\n";
           }
       }

       cout << setw(14)<< "|" << setw(10) << "|\n";
       if (i != 2)
       {
       cout << setw(32) << "--------------------------\n";
       }
   }
   cout << endl << endl;
}

/******************************************************************************
* GetPlayers
* This function prompts the user and gets the input for the players’ names.
* player1 contains the name of the player that is using the X token.
* player2 contains the name of the player that is using the O token.
*
* RETURNS: the token opposite of the one in which it receives.
*****************************************************************************/

void GetPlayers(string& player1, string& player2)
{
   cout << "\nEnter the name of player 1(X) : ";
   getline (cin, player1);
   cout << "Enter the name of player 2(O) : ";
   getline (cin, player2);
}

void GetAndCheckInp(char board[][3], char token, string player1, string player2)
{
   int row;
   int col;
   bool valid;

   do
   {
       if (token == 'X')
       {
           cout << player1 << "'s turn What's your play? : "<<endl;

           cout << "Row? : "<<endl;
           cin >> row;

           cout << "Column? : "<<endl;
           cin >> col;
       }

       else if (token == 'O')
       {
           cout << player2 << "'s turn: What's your play?"<<endl;

           cout << "Row? : "<<endl;
           cin >> row;

           cout << "Column? : "<<endl;
           cin >> col;
       }

       row--;
       col--;

       if ((row > NUM_ROWS || row < 0) || (col > 3 || col < 0))
       {
           valid = false;
           cout << "Please chose a space on the board." << endl;
       }

       else if (board[row][col] != ' ')
       {
           valid = false;
           cout << "That space is already taken, choose another"<<endl;
       }

       else
       {
           valid = true;
           board[row][col] = token;
           sum++;
       }

   } while (!valid);
}

/******************************************************************************
* SwitchToken
*
* RETURNS: the token opposite of the one in which it receives.
*****************************************************************************/

char SwitchToken(char token) // current player’s token ('X' or 'O') - IN
{
   if (toupper(token) == 'X')
   {
       token = 'O';
   }

   else if (toupper(token) == 'O')
   {
       token = 'X';
   }

   return token;
}

/******************************************************************************
* CheckWin
* This function checks to see if either player has won.
* RETURNS the character value of the player that won or T if it was a tie
* or N if no won
*****************************************************************************/

char CheckWin(const char board[][3]) // tic tac toe board - IN
{
   char win = ' ';

   // Checks for three same value horizental
   for (int i = 0; i < 3; i++)
       if (board[i][0] == board[i][1] && board[i][1] == board[i][2]) return board[i][0];

   // Checks for three same value vertical
   for (int i = 0; i < 3; i++)
       if (board[0][i] == board[1][i] && board[1][i] == board[2][i]) return board[0][i];

   // Checks for three same value diagnal
   if ((board[0][0] == board[1][1] && board[1][1] == board[2][2]) || (board[0][2] == board[1][1] && board[1][1] == board[2][0]))
       return board[1][1];

   // Checks if there is any square left
   for (int i = 0; i < 3; i++)
       for (int j = 0; j < 3; j++)
           if (board[i][j] == ' ')
               return ' ';

   // returns draw
   return 'T';
}

/******************************************************************************
* OutputWinner
*
* RETURNS: nothing
* Displays the winner’s name
*****************************************************************************/

void OutputWinner(char whoWon, string player1, string player2)
{
   if (whoWon == 'X')
   {
       cout << player1 << " has won the game"<<endl;
   }

   else if (whoWon == 'O')
   {
       cout << player2 << " has won the game"<<endl;;
   }

   else if (whoWon == 'T')
   {
       cout << player1 << " and " << player2 << " have tied"<<endl;;
   }
}

#endif

>>>>>>>>>>>>>Main program >>>>>>>>>>>>>>>>>>>>>>>

#include "myheader.h"

int main()
{
   const int NUM_ROWS = 3;
   const int NUM_COLS = 3;

   // Variables
   string player1;
   string player2;

   GetPlayers(player1, player2);

   bool again;

   do
   {
       // Variables
       bool won;
       char board[NUM_ROWS][NUM_COLS];
       char token;
       char input;

       won = false;
       again = true;

       InitBoard(board);
       OutputInstruct();

       token = 'O';

       while(!won)
       {
           token = SwitchToken(token);
           GetAndCheckInp(board, token, player1, player2);

           if (CheckWin(board) != ' ')
           {
               won = true;
           }

           DisplayBoard(board);
       }

       OutputWinner(CheckWin(board), player1, player2);

       //asking user to play again
       cout<<"\nPlay again? (Y/N) : ";
       cin>>input;

       again = toupper(input)=='Y';

   } while(again);

   return 0;
}

In: Computer Science

Write java statements that compare objects, obj1 and obj2, using the getClass() method.

Write java statements that compare objects, obj1 and obj2, using the getClass() method.

In: Computer Science

Given the following C function prototype which accepts an integer argument, complete the implementation of the...

Given the following C function prototype which accepts an integer argument, complete the implementation of the function in C language to return the number of 1’s in the binary representation of the number passed.

For example if the number is (011100011 ) then the function should return 5 as the number of 1s. Please remember that an integer is 32 bits long.

USE the following function int countOnes(int number)

Write a full c program that has the header required and will accept the user entry.

In: Computer Science

Woodbridge's stock is currently selling for $26.00 a share but is expected to decrease to either...

Woodbridge's stock is currently selling for $26.00 a share but is expected to decrease to either $23.40 or increase to $28.60 a share over the next year. The risk-free rate is 3 percent. What is the current value of a 1-year call option with an exercise price of $26?

$1.50

$1.64

$1.72

$1.86

$2.02

In: Finance