Answer:
The solution is as follows.
class LFilters implements Lock {
int[] lvl;
int[] vic;
public LFilters(int n, int l) {
lvl = new int[max(n-l+1,0)];
vic = new int[max(n-l+1,0)];
for (int i = 0; i < n-l+1; i++) {
lvl[i] = 0;
}
}
public void lock() {
int me = ThreadID.get();
for (int i = 1; i < n-l+1; i++) { // attempt level i
lvl[me] = i;
vic[i] = me;
// rotate while conflicts exist
int above = l+1;
while (above > l && vic[i] == me) {
above = 0;
for (int k = 0; k < n; k++) {
if (lvl[k] >= i) above++;
}
}
}
}
public void unlock() {
int me = ThreadID.get();
lvl[me] = 0;
}
}
Explanation:
The code is presented above in which the a class is formed which has two variables, lvl and vic. It performs the operation of lock as indicated above.
Answer:
An error will be occurred here. In C++ a function must be like
returntype function_name(){
}
but the functions in given class does not have returntype given. So there will be a syntax error.
If the returntype is defined then the code does not show any output since nothing is printed in the main function.
Answer:
D. Add
Explanation:
PowerPoint application can be defined as a software application or program designed and developed by Microsoft, to avail users the ability to create various slides containing textual and multimedia informations that can be used during a presentation. Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.
In this scenario, Dione has created a PowerPoint presentation that has several common nouns, names of products, etc. He is running Spell Checker and does not want to be notified in regard to these words in this presentation or in any other presentation created on this computer. Hence, the option he should choose is Add. This would be used to automatically add a list of all the common nouns.
Answer: Find answers in the attachments
Explanation:
The factor that is a best choice for the personal trainer in their initial meeting is option a: Inquire further about what their motives are for participating.
<h3>What are the motives in motivation?</h3>
Psychologists is known to have shared motives into three types which are:
- Biological motives
- Social motives
- Personal motives.
Note that the goal that is to be meant is for the fulfillment of the client want or their need.
Therefore asking the right question will go a long way in satisfying them. So, The factor that is a best choice for the personal trainer in their initial meeting is option a: Inquire further about what their motives are for participating.
Learn more about personal trainer from
brainly.com/question/19462080
#SPJ1
A new client has indicated that they are exercising due to advice from their physician, but they are generally amotivated. What would be the best choice for the personal trainer in their initial meeting?
Inquire further about what their motives are for participating.
Create a plan for overcoming barriers.
Establish short- and long-term goals.
Start establishing an emotional support system.