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:
Explanation:
We can use for-loop in python to calculate the tuition amount in the next 5 years. If the tuition is increasing 3% each year, in each loop we can multiply the amount by 1.03
tuition = 8000
for year in range(1,6):
tuition *= 1.03
print("The tuition amount after " + str(year) + " year(s) is $" + str(tuition))
B. An adaptive score changes in response to player actions in the game.
it <em>could</em> be D. if the context was in a musical score...like an orchestra...I think that's just there to be funny
Answer: (A) Fixed interval
Explanation:
The fixed interval schedule is the type of schedule of the reinforcement in the operand conditioning in which the the initial response are rewarded by some specific amount of the time.
The main issue with the fixed interval schedule is that the people have to wait until the reinforcement schedule get occur and start their actual response of interval. This type of reinforcement schedule occur as the output value does not posses constant value all the time.
Therefore, Option (A) is correct.