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
Fiesta28 [93]
4 years ago
8

The right of workers to seek safety and health on the job without fear of punishment is spelled out in:

Computers and Technology
1 answer:
mr Goodwill [35]4 years ago
3 0
The answer to the question is C.
You might be interested in
g You are looking to rob a jewelry store. You have been staking it out for a couple of weeks now and have learned the weights an
ololo11 [35]

Answer:

A python code (Python recursion) was used for this given question

Explanation:

Solution

For this solution to the question, I am attaching code for these 2 files:

item.py

code.py

Source code for item.py:

class Item(object):

def __init__(self, name: str, weight: int, value: int) -> None:

  self.name = name

  self.weight = weight

  self.value = value

def __lt__(self, other: "Item"):

  if self.value == other.value:

if self.weight == other.weight:

  return self.name < other.name

else:

  return self.weight < other.weight

  else:

   return self.value < other.value

def __eq__(self, other: "Item") -> bool:

  if is instance(other, Item):

return (self.name == other.name and

self.value == other.value and

self.weight == other.weight)

  else:

return False

def __ne__(self, other: "Item") -> bool:

  return not (self == other)

def __str__(self) -> str:

  return f'A {self.name} worth {self.value} that weighs {self.weight}'

Source code for code.py:

#!/usr/bin/env python3

from typing import List

from typing import List, Generator

from item import Item

'''

Inductive definition of the function

fun3(0) is 5

fun3(1) is 7

fun3(2) is 11

func3(n) is fun3(n-1) + fun3(n-2) + fun3(n-3)

Solution 1: Straightforward but exponential

'''

def fun3_1(n: int) -> int:

result = None

if n == 0:

result = 5 # Base case

elif n == 1:

result = 7 # Base case

elif n == 2:

result = 11 # Base case

else:

result = fun3_1(n-1) + fun3_1(n-2) + fun3_1(n-3) # Recursive case

return result

''

Solution 2: New helper recursive function makes it linear

'''

def fun3(n: int) -> int:

''' Recursive core.

fun3(n) = _fun3(n-i, fun3(2+i), fun3(1+i), fun3(i))

'''

def fun3_helper_r(n: int, f_2: int, f_1: int, f_0: int):

result = None

if n == 0:

result = f_0 # Base case

elif n == 1:

result = f_1 # Base case

elif n == 2:

result = f_2 # Base case

else:

result = fun3_helper_r(n-1, f_2+f_1+f_0, f_2, f_1) # Recursive step

return result

return fun3_helper_r(n, 11, 7, 5)

''' binary_strings accepts a string of 0's, 1's, and X's and returns a generator that goes through all possible strings where the X's

could be either 0's or 1's. For example, with the string '0XX1',

the possible strings are '0001', '0011', '0101', and '0111'

'''

def binary_strings(string: str) -> Generator[str, None, None]:

def _binary_strings(string: str, binary_chars: List[str], idx: int):

if idx == len(string):

yield ''.join(binary_chars)

binary_chars = [' ']*len(string)

else:

char = string[idx]

if char != 'X':

binary_chars[idx]= char

yield from _binary_strings(string, binary_chars, idx+1)

else:

binary_chars[idx] = '0'

yield from _binary_strings(string, binary_chars, idx+1)

binary_chars[idx] = '1'

yield from _binary_strings(string, binary_chars, idx+1)

binary_chars = [' ']*len(string)

idx = 0

yield from _binary_strings(string, binary_chars, 0)

''' Recursive KnapSack: You are looking to rob a jewelry store. You have been staking it out for a couple of weeks now and have learned

the weights and values of every item in the store. You are looking to

get the biggest score you possibly can but you are only one person and

your backpack can only fit so much. Write a function that accepts a

list of items as well as the maximum capacity that your backpack can

hold and returns a list containing the most valuable items you can

take that still fit in your backpack. '''

def get_best_backpack(items: List[Item], max_capacity: int) -> List[Item]:

def get_best_r(took: List[Item], rest: List[Item], capacity: int) -> List[Item]:

if not rest or not capacity: # Base case

return took

else:

item = rest[0]

list1 = []

list1_val = 0

if item.weight <= capacity:

list1 = get_best_r(took+[item], rest[1:], capacity-item.weight)

list1_val = sum(x.value for x in list1)

list2 = get_best_r(took, rest[1:], capacity)

list2_val = sum(x.value for x in list2)

return list1 if list1_val > list2_val else list2

return get_best_r([], items, max_capacity)

Note: Kindly find an attached copy of the code outputs for python programming language below

5 0
3 years ago
If there is an int/integer in a array, and the same int/integer comes at the same spot, does it cancel each other out or does it
joja [24]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

When you use an array in the program, it occupies the memory where to store the data. However, it is noted that the other array cannot store the variable value where the first array has to store its variable value.

however, when you reassign the value their index position of the array, the values are reassigned. But it also depends on the CPU, because sometimes when you release the memory from the array, maybe some other programs get to occupy that location where the first array values were stored.

However, In Java, it is possible that the same int/integer comes at the same spot of the existing integer in an array, then the value at that particular index is reassigned.

7 0
3 years ago
Data erasure software uses standards that are called.
Leviafan [203]

Data erasure software uses standards that are called Typically, a software program device is used for information erasure like BitRaser, which implements the overwriting sample primarily based totally on the usual used, together with US DoD 5220.22, NIST 800-88.

<h3>What is statistics erasure?</h3>

For virtual garage devices, erasing names after its developer, the Gutmann set of rules is a way of disk wiping that overwrites statistics the usage of a complete of 35 passes. This makes it one of the maximum steady statistics erasure methods, however additionally the maximum time-consuming.

The statistics manner that zeros and ones are verifiably overwritten onto all sectors of the device. This renders all statistics completely unrecoverable at the same time as retaining the capability of the device the beyond few years, NIST Special Publication 800-88 has end up the go-to statistics erasure preferred withinside the United States.

Read more about the software :

brainly.com/question/1538272

#SPJ1

8 0
2 years ago
You are attempting to run a Nmap portscan on a web server. Which of the following commands would result in a scan of common port
Bess [88]

Answer:

Nmap CST CO CT0

Explanation:

Network map (Nmap) is a network scanning and host detection tool used in penetration testing to sorting out vulnerability in a network. Nmap APIs are used in packet sniffer tools as well to scan for available networks. There are different nmap command , but the command needed to scan a port with less noise to evade an IDS is the nmap's "Nmap CST CO CT0" command.

5 0
3 years ago
In chapter 3, we discussed syntax and semantics, in general there are two types of grammars for programming languages, regular a
WARRIOR [948]

Answer:

Lexical rules that are defined in case of regular grammar are simple and the notation is quite easy to understand.

Regular expression are useful for defining constructs of identifiers or constants. e.g. a|b etc.

In the case of context-free, grammar is not simple and deals with the productions.

Context-free are useful in describing the nested constructs like if-else etc which are not defined by regular expressions.

These produce a higher level of reliability as it provides a medium for generating syntactical as well as semantic data. The grammar is context-free is a little complex.

Explanation:

8 0
3 years ago
Other questions:
  • Based on the chart below, which pie flavors make up approximately one-half of the total? A pie chart shows the following pie fla
    7·2 answers
  • If you increase or decrease the font size of one shape, the font size in other shapes will not be affected. True False
    14·1 answer
  • When using a line graph, why is it important to only graph 1-3 series of data?
    14·1 answer
  • Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
    8·2 answers
  • What directs the read/write arm of the hard drive to where data exists and accesses it upon the user's request?
    8·1 answer
  • A student who used a regression model that included indicator variables was upset when receiving only the following output on th
    10·1 answer
  • How would asking questions or defining problems be used in this career?<br> -
    13·1 answer
  • 2. The<br>is the main and usually largest data storage hardware device in a computer​
    9·1 answer
  • Convert Fahrenheit to Celsius using this formula: F = (9/5)*C+32
    5·1 answer
  • When a derived class method has the same name as a base class method, it is often said that the derived class method ________ th
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!