Question

In: Computer Science

Case Project 4-2: Configuring Preferences Users in the Engineering Department need a higher level of access...

Case Project 4-2: Configuring Preferences

Users in the Engineering Department need a higher level of access on their local computers than other users do. In addition, you want to set power options on mobile computers that Engineering users use. All Engineering Department user and computer accounts are in the Engineering OU.

What should you configure to meet the following criteria?

• When an Engineering user signs into a computer, the user account is added to the local Administrators group on that computer.

• Enable the hibernation power mode but only if the user’s computer is identified as a portable computer. Set the power scheme to hibernate mode if the laptop’s lid is closed or the power button is pressed.

Solutions

Expert Solution

CODE:

#include       

#include       

#include       

#include       

#include       

#include       

#include       

#include

// PURPOSE: To tell the maximum value that a tree can have.

const int       MAX_VALUE               = 64;

// PURPOSE: To tell how many problems to do.

const int       NUM_PROBLEMS            = 4096;

#include        "Node.h"

#include        "NodeBuffer.h"

        Node.h                                                                                                                 

     This file defines classes for nodes used to represent math

   expressions.                                                                                                                                    

// PURPOSE: To distinguish among the mathematical operators.

typedef         enum            {

                                  ADD_OP,

                                  SUBTRACT_OP,

                                  MULTIPLY_OP,

                                  DIVIDE_OP,

                                  NUM_OPS

                                }

                                operator_ty;

// PURPOSE: To serve as the base class for the Node classes.

class           Node

{

public :

Node                          ()

                                { }

virtual

~Node                         ()

                                { }

virtual

double        eval            ()

                                const

                                = 0;

virtual

std::string   toString        ()

                                const

                                = 0;

};

// PURPOSE: To represent a constant.

class           ConstNode : public Node

{

double                        constant_;

public :

ConstNode                     () :

                                Node(),

                                constant_((double)((rand() % MAX_VALUE) + 1) )

                                { }

double        eval            ()

                                const

                                { return(constant_); }

std::string   toString        ()

                                const

                                {

                                  std::ostringstream    stream;

                                  stream << constant_;

                                  return(stream.str());

                                }

};

// PURPOSE: To return a randomly generated Node.

extern

Node*           makeNode        ();

// PURPOSE: To represent an operation.

class           OperatorNode : public Node

{

operator_ty                   operator_;

Node*                         lhsPtr_;

Node*                         rhsPtr_;

public :

OperatorNode                  () :

                                Node(),

                                operator_((operator_ty)(rand() % NUM_OPS)),

                                lhsPtr_(makeNode()),

                                rhsPtr_(makeNode())

                                { }

~OperatorNode                 ()

                                {

                                  delete(rhsPtr_);

                                  delete(lhsPtr_);

                                }

double        eval            ()

                                const

                                {

                                  double        lhs     = lhsPtr_->eval();

                                 double        rhs     = rhsPtr_->eval();

                                  double        result;

                                  switch (operator_)

                                  {

                                  case ADD_OP :

                               

                                    result      = lhs + rhs;

                                    break;

                                  case SUBTRACT_OP :

                                    result      = lhs - rhs;

                                    break;

                                  case MULTIPLY_OP :

                                    result      = lhs * rhs;

                                    break;

                                  case DIVIDE_OP :

                                    result      = lhs / rhs;

                                    break;

                                  }

                                  return(result);

                                }

std::string   toString        ()

                                const

                                {

                                  std::ostringstream    stream;

                                  const char*           operatorNameCPtr;

                                  switch (operator_)

                                  {

                                  case ADD_OP :

                                    operatorNameCPtr    = " + ";

                                    break;

                                  case SUBTRACT_OP :

                                    operatorNameCPtr    = " - ";

                                    break;

                                  case MULTIPLY_OP :

                                    operatorNameCPtr    = " * ";

                                    break;

                                  case DIVIDE_OP :

                                    operatorNameCPtr    = " / ";

                                    break;

                                  }

                                  stream << "(" << lhsPtr_->toString()

                                         << operatorNameCPtr

                                         << rhsPtr_->toString() << ")";

                                  return(stream.str());

                                }

};

   NodeBuffer.h                                                                                                         

  This file defines a class that implements a thread-safe    

   buffer of pointers to math expressions.                                                                             

  Version 1a              2018 February 22        Joseph Phillips                                         

class   NodeBuffer

{

enum { SIZE   = 16 };

Node*   array_[SIZE];

int   inIndex_;

int   outIndex_;

int   numItems_;

public :

NodeBuffer        ()

{

    for (int i = 0; i < SIZE; i++)

    {

      array_[i] = NULL;

    }

    inIndex = outIndex = numItems_ = 0;

}

~NodeBuffer       ()

{

}

int   getNumItems () const

{ return(numItems_); }

void putIn (Node* nodePtr)

{

    while (getNumItems() >= SIZE)

    {

    }

    array_[inIndex_] = nodePtr;

    inIndex_++;

    numItems_++;

    if (inIndex_ >= SIZE)

      inIndex_ = 0;

}

Node*   pullOut ()

{

    while (getNumItems() <= 0)

    {

    }

    Node* toReturn        = array_[outIndex_];

    array_[outIndex_]     = NULL;

    outIndex_++;

    numItems_--;

    if (outIndex_ >= SIZE)

      outIndex_ = 0;

    return(toReturn);

}

}

                                                       

mathSolver.cpp                                                                                                  

This file defines the high-level functions of the math    

  generator and solver program.                                

//

//      Compile with:

//      $ g++ mathSolver.cpp -o mathSolver -lpthread -g

//

#include        "mathSolverHeader.h"

void           evaluate        (void          vPtr

                                )

{

NodeBuffer*   nodeBufferPtr   = (NodeBuffer*)vPtr;

// YOUR CODE HERE

}

// PURPOSE: To return a randomly generated Node.

Node*           makeNode        ()

{

return( (rand() % 3) ? (Node*)new ConstNode() : (Node*)new OperatorNode() );

}

int             main            (int            argc,

                                 char*          argv[]

                                )

{

NodeBuffer    nodeBuffer;

pthread_t     consumer0;

pthread_t     consumer1;

int           toReturn        = EXIT_SUCCESS;

srand( (argc < 2) ? getpid() : atoi(argv[1]) );

return(toReturn);

}


Related Solutions

I need some ideas for software engineering project
I need some ideas for software engineering project
There is an engineering project that uses complex numbers, electrical circuits. you need to develop a...
There is an engineering project that uses complex numbers, electrical circuits. you need to develop a user-defined structure type and a set of operations that will make complex arithmetic virtually as straightforward as arithmetic on C’s built-in numeric types. You will need to define functions for complex I/O as well as for the basic arithmetic operations (addition, subtraction, and for finding the absolute value of a complex number). Hint: the complex number a + bi has a real part a...
4. The Indiana Highway Department wants to construct a new rural highway. The engineering team is...
4. The Indiana Highway Department wants to construct a new rural highway. The engineering team is considering two designs: a. Design A calls for a concrete pavement costing $90/ft. with a 20-year life, two paved ditches each costing $3/ft., three box culverts each costing $9,000/mile, annual maintenance costs of $1,800/mile, culvert cleaning costs of $450/mile every five years. Design A has a 20-year life. b. Design B calls for a bituminous pavement costing $45/ft. with a 10-year life, two sodded...
I need new ideas for chemical engineering project, new ideas plz , thanks
I need new ideas for chemical engineering project, new ideas plz , thanks
I need assistance determining the steps required to answer the Chapter 4 Data Case questions 2,...
I need assistance determining the steps required to answer the Chapter 4 Data Case questions 2, 3, and 4 in the Fundamentals of Corporate Finance 4th edition by Berk, DeMarzo and Harford. I have provided the answer to question 1. An analysis isn't required. Only the steps to obtain the answers. Can anyone help? Data Case: Assume that today is August 5, 2015, Natasha Kingery is 30 years old and has a Bachelor of Science degree in computer science. She...
1. As part of a major plant renovation project, the industrial engineering department has been asked...
1. As part of a major plant renovation project, the industrial engineering department has been asked to balance a revised assembly operation to achieve an output of 240 units per eight-hour day. Task times and precedence relationships are as follows: Task Duration (minutes) Immediate Predecessor A 0.3 - B 0.5 A C 0.4 B D 0.5 - E 1.9 D F 0.8 C G 1.2 E, F Draw the precedence diagram. Determine the minimum cycle time, the maximum cycle time,...
Case study Project planning stage is the most challenging phase for a project manager. Managers need...
Case study Project planning stage is the most challenging phase for a project manager. Managers need to make an educated guess about resources needed to complete the project. A project manager need to also plan and establish communications and procurement activities, in addition he or she need to contract suppliers. Select any project that you like (i.e. stating any type of business). This is NOT a paper style of case. You are to report the following issues as titles and...
At a conceptual level what do you need to know about a project or a firm...
At a conceptual level what do you need to know about a project or a firm to tell whether it is expected to create value?
2. Discuss how a higher level of entrepreneurship promotes different aspects of macroeconomic performance
2. Discuss how a higher level of entrepreneurship promotes different aspects of macroeconomic performance
(ONLY NEED ANSWER FOR PART 4 OF THIS CASE STUDY) Wana Decryptor Attack Case Study -...
(ONLY NEED ANSWER FOR PART 4 OF THIS CASE STUDY) Wana Decryptor Attack Case Study - Part 1 Scenario: You are employed at a bank of medium size, worth 5 billion dollars. The IT Director reports to the CIO – both the CIO and CISO report to the COO. At 11:00 A.M. on a Monday morning, the IT Help Desk receives a call from a user in the Wire Transfer Department. He reports that his computer is frozen and appears...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT