Answer:
B. The process will be terminated by the operating system.
Explanation:
When Round Robin is used for CPU scheduling, a time scheduler which is a component of the operating system is used in regulating the operation. A time limit is set for each of the processes to be run.
So, when a process fails to complete running before its time elapses, the time scheduler would log it off and return it to the queue. This queue is in a circular form and gives each of the processes a chance to run its course.
Answer:
Pseudocode is as follows:
// below is a function that takes two parameters:1. An array of items 2. An integer for weight W
// it returns an array of selected items which satisfy the given condition of sum <= max sum.
function findSubset( array items[], integer W)
{
initialize:
maxSum = 0;
ansArray = [];
// take each "item" from array to create all possible combinations of arrays by comparing with "W" and // "maxSum"
start the loop:
// include item in the ansArray[]
ansArray.push(item);
// remove the item from the items[]
items.pop(item);
ansArray.push(item1);
start the while loop(sum(ansArray[]) <= W):
// exclude the element already included and start including till
if (sum(ansArray[]) > maxSum)
// if true then include item in ansArray[]
ansArray.push(item);
// update the maxSum
maxSum = sum(ansArray[items]);
else
// move to next element
continue;
end the loop;
// again make the item[] same by pushing the popped element
items.push(item);
end the loop;
return the ansArray[]
}
Explanation:
You can find example to implement the algorithm.
Answer:
JPG / JPEG best choice and work well on websites
Explanation:
JPEGs contains millions of colors, so this type of file is ideal for photographs.
Best choice for posting on social media channels
a. stateTaxRate - A good variable name because it represents what it holds, the state sales tax rate, without being too wordy. Also correctly capitalized in camelcase.
b. txRt - A bad variable name because while short and simple, it is too hard to understand what the variable represents.
c. t - A very bad variable name if you plan on using the variable often. Far too short and you will forget what it represents and is needed for.
d. stateSalesTaxRateValue - A bad variable name because it is just too wordy. Cutting it down to A's variable name is much more reasonable
e. state tax rate - A bad variable name and probably invalid because it has spaces in the name.
f. taxRate - A good variable name if there are no other tax calculations other than state tax rate. Otherwise you would confuse state vs local tax rate or something, making it a bad variable name.
g. 1TaxRate - A bad variable name because the number 1 has no reason being in the variable name. It doesn't add anything to the name.
h. moneyCharged - A bad variable name because it is not specific enough in explaining why the money is being charged and what for.
First, we have to understand what scope is. When variables are declared, they are only available in the code block they're declared in, unless they're global variables (this doesn't apply here).
strFirst is declared in usernameMaker and that is the only place it is available in.