1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
o-na [289]
3 years ago
10

This problem has been solved!

Engineering
1 answer:
lisov135 [29]3 years ago
5 0

Answer: a) 135642 b) 146253

Explanation:

A)

1- the bankers algorithm tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, as stated this has the greatest degree of concurrency.

3- reserving all resources in advance helps would happen most likely if the algorithm has been used.

5- Resource ordering comes first before detection of any deadlock

6- Thread action would be rolled back much easily of Resource ordering precedes.

4- restart thread and release all resources if thread needs to wait, this should surely happen before killing the thread

2- only option practicable after thread has been killed.

Bii) ; No. Even if deadlock happens rapidly, the safest sequence have been decided already.

You might be interested in
More discussion about seriesConnect(Ohm) function In your main(), first, construct the first circuit object, called ckt1, using
STALIN [3.7K]

Answer:

resistor.h

//circuit class template

#ifndef TEST_H

#define TEST_H

#include<iostream>

#include<string>

#include<vector>

#include<cstdlib>

#include<ctime>

#include<cmath>

using namespace std;

//Node for a resistor

struct node {

  string name;

  double resistance;

  double voltage_across;

  double power_across;

};

//Create a class Ohms

class Ohms {

//Attributes of class

private:

  vector<node> resistors;

  double voltage;

  double current;

//Member functions

public:

  //Default constructor

  Ohms();

  //Parameterized constructor

  Ohms(double);

  //Mutator for volatage

  void setVoltage(double);

  //Set a resistance

  bool setOneResistance(string, double);

  //Accessor for voltage

  double getVoltage();

  //Accessor for current

  double getCurrent();

  //Accessor for a resistor

  vector<node> getNode();

  //Sum of resistance

  double sumResist();

  //Calculate current

  bool calcCurrent();

  //Calculate voltage across

  bool calcVoltageAcross();

  //Calculate power across

  bool calcPowerAcross();

  //Calculate total power

  double calcTotalPower();

  //Display total

  void displayTotal();

  //Series connect check

  bool seriesConnect(Ohms);

  //Series connect check

  bool seriesConnect(vector<Ohms>&);

  //Overload operator

  bool operator<(Ohms);

};

#endif // !TEST_H

resistor.cpp

//Implementation of resistor.h

#include "resistor.h"

//Default constructor,set voltage 0

Ohms::Ohms() {

  voltage = 0;

}

//Parameterized constructor, set voltage as passed voltage

Ohms::Ohms(double volt) {

  voltage = volt;

}

//Mutator for volatage,set voltage as passed voltage

void Ohms::setVoltage(double volt) {

  voltage = volt;

}

//Set a resistance

bool Ohms::setOneResistance(string name, double resistance) {

  if (resistance <= 0){

      return false;

  }

  node n;

  n.name = name;

  n.resistance = resistance;

  resistors.push_back(n);

  return true;

}

//Accessor for voltage

double Ohms::getVoltage() {

  return voltage;

}

//Accessor for current

double Ohms::getCurrent() {

  return current;

}

//Accessor for a resistor

vector<node> Ohms::getNode() {

  return resistors;

}

//Sum of resistance

double Ohms::sumResist() {

  double total = 0;

  for (int i = 0; i < resistors.size(); i++) {

      total += resistors[i].resistance;

  }

  return total;

}

//Calculate current

bool Ohms::calcCurrent() {

  if (voltage <= 0 || resistors.size() == 0) {

      return false;

  }

  current = voltage / sumResist();

  return true;

}

//Calculate voltage across

bool Ohms::calcVoltageAcross() {

  if (voltage <= 0 || resistors.size() == 0) {

      return false;

  }

  double voltAcross = 0;

  for (int i = 0; i < resistors.size(); i++) {

      voltAcross += resistors[i].voltage_across;

  }

  return true;

}

//Calculate power across

bool Ohms::calcPowerAcross() {

  if (voltage <= 0 || resistors.size() == 0) {

      return false;

  }

  double powerAcross = 0;

  for (int i = 0; i < resistors.size(); i++) {

      powerAcross += resistors[i].power_across;

  }

  return true;

}

//Calculate total power

double Ohms::calcTotalPower() {

  calcCurrent();

  return voltage * current;

}

//Display total

void Ohms::displayTotal() {

  for (int i = 0; i < resistors.size(); i++) {

      cout << "ResistorName: " << resistors[i].name << ", Resistance: " << resistors[i].resistance

          << ", Voltage_Across: " << resistors[i].voltage_across << ", Power_Across: " << resistors[i].power_across << endl;

  }

}

//Series connect check

bool Ohms::seriesConnect(Ohms ohms) {

  if (ohms.getNode().size() == 0) {

      return false;

  }

  vector<node> temp = ohms.getNode();

  for (int i = 0; i < temp.size(); i++) {

      this->resistors.push_back(temp[i]);

  }

  return true;

}

//Series connect check

bool Ohms::seriesConnect(vector<Ohms>&ohms) {

  if (ohms.size() == 0) {

      return false;

  }

  for (int i = 0; i < ohms.size(); i++) {

      this->seriesConnect(ohms[i]);

  }

  return true;

}

//Overload operator

bool Ohms::operator<(Ohms ohms) {

  if (ohms.getNode().size() == 0) {

      return false;

  }

  if (this->sumResist() < ohms.sumResist()) {

      return true;

  }

  return false;

}

main.cpp

#include "resistor.h"

int main()

{

   //Set circuit voltage

  Ohms ckt1(100);

  //Loop to set resistors in circuit

  int i = 0;

  string name;

  double resistance;

  while (i < 3) {

      cout << "Enter resistor name: ";

      cin >> name;

      cout << "Enter resistance of circuit: ";

      cin >> resistance;

      //Set one resistance

      ckt1.setOneResistance(name, resistance);

      cin.ignore();

      i++;

  }

  //calculate totalpower and power consumption

  cout << "Total power consumption = " << ckt1.calcTotalPower() << endl;

  return 0;

}

Output

Enter resistor name: R1

Enter resistance of circuit: 2.5

Enter resistor name: R2

Enter resistance of circuit: 1.6

Enter resistor name: R3

Enter resistance of circuit: 1.2

Total power consumption = 1886.79

Explanation:

Note

Please add all member function details.Its difficult to figure out what each function meant to be.

8 0
3 years ago
What is the first step in the Design Process *
Gennadij [26K]

Answer:

Define the problem

I hope this helps!

Explanation:

The problem must be know before you can develop and solution, generate concepts, or construct and test a prototype

8 0
3 years ago
NO LINKS PLS
vivado [14]

Answer:

C. Aerosol spray cans. I hope this helps

6 0
3 years ago
Read 2 more answers
A piston moves a 25kg hammerhead vertically down 1m from rest to a
UkoKoshka [18]

Answer:

Total change in energy = 31 KJ.

Explanation:

Mass m=25 kg

Height h = 1 m

Initial velocity = 0

Final velocity = 50 m/s

Energy at initial condition

E_1=mgh+\dfrac{1}{2}mv^2

E_1=25\times 10\times 1+0

E_1=250\ J

Energy at final condition

E_2=0+\dfrac{1}{2}\times 25\times 50^2

E_2=31250\ J

So the change in energy = 31250 -250 J

The total change in energy = 31000 J

5 0
4 years ago
Read 2 more answers
Resolver em c as equações:<br><br> Z elevado à 2 igual a 3+4i
Marrrta [24]

Answer:

Quando um (ou todos) os outros coeficientes de uma equação do segundo grau são iguais a zero, essa equação é chamada incompleta. Neste artigo, analisaremos os métodos que podem ser usados para resolver equações incompletas, no caso em que o coeficiente C = 0, ou seja, o coeficiente é nulo.

Explanation:

Um lado da equação será a potência e outro, o número inteiro. De outro modo, transforme a equação deixando-a isolada em um dos lados. Reescreva a equação. Prepare-a a fim de extrair o logaritmo de ambos os lados, que é o inverso da potência. Você pode calcular o logaritmo de base.

3 0
3 years ago
Other questions:
  • Use Newton's method to determine the angle θ, between 0 and π/2 accurate to six decimal places. for which sin(θ) = 0.1. Show you
    12·1 answer
  • What is over head line
    13·1 answer
  • Many car companies are performing research on collision avoidance systems. A small prototype applies engine braking that deceler
    15·1 answer
  • Assume all surface are smooth Draw the FBD for each body
    15·1 answer
  • A local reaction is when a chemical enters the bloodstream?
    5·1 answer
  • What is the relationship between the distance of the fall (height) and the formation of splines and satellite drops?
    12·1 answer
  • In a residence, the control of a room's baseboard electric resistance heating system would be accomplished automatically using a
    12·2 answers
  • Determine the wattmeter reading when it is connected to resistor load.​
    11·1 answer
  • Ow is squeezing toothpaste out of a tube of toothpaste similar to peristalsis?
    12·1 answer
  • The most important reason to wear your seat belt is to protect you from:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!