Question

explain what a Sentinel control value is. What control structure uses it? In what context do...

explain what a Sentinel control value is. What control structure uses it? In what context do you think Sentinel Control value is commonly use?

Homework Answers

Answer #1

Sentinel:

A sentinel is a value that is used for the loop control and determines whether the body of the loop must be executed or not.

The sentinels are used by the loop control structures.

In general the sentinel values are used when the number of times the loop must be executed is not known in prior.

During the execution process of the loop, the sentinel value can be used to determine if the loop must still be executed.

Consider an example of a program that reads the positive numbers from the user.

In such a case, when the number of numbers to be read is not known.

So when the input is negative, the reading of numbers must be stopped.

Here, the sentinel can be used and when the input is negative, the loop that is used to read numbers from the user can be terminated.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Prokaryotes commonly use attenuation as a mechanism to control gene expression, but eukaryotes do not. Why...
Prokaryotes commonly use attenuation as a mechanism to control gene expression, but eukaryotes do not. Why do you think that attenuation is more common in prokaryotes than eukaryotes?
Explain What is sentinel in python. Calculating a Running Total
Explain What is sentinel in python. Calculating a Running Total
Explain the capital structure of General Motor's. Do they rely more heavily on debt or equity?...
Explain the capital structure of General Motor's. Do they rely more heavily on debt or equity? What are their structure weights (%’s)? How does this structure contribute to the overall risk of your firm? Do you feel they have chosen an ideal capital structure? What would you do to improve their structure if you could be CEO for a day? Update in response to a question: General Motors Company, commonly referred to as General Motors, is an American multinational corporation...
Do you think budgeting is important for both planning and control? Explain.
Do you think budgeting is important for both planning and control? Explain.
Explain the concept of time value of money in the context of simple interest. How would...
Explain the concept of time value of money in the context of simple interest. How would you use this in retirement planning
If a group of sellers could form a cartel, what market structure would that be? Explain....
If a group of sellers could form a cartel, what market structure would that be? Explain. Based on the actions of the cartel members, what quantity and price do you think they would try to set? Provide specific examples to support your examples.
1.What is the managerial context in which these managers will be operating? Do you think training...
1.What is the managerial context in which these managers will be operating? Do you think training designed to help managers understand the context they will be operating in will be helpful? Why or why not? 2. What types of competencies should be developed in the management training? Give your rationale. NOTEBOOK: EFFECTIVE TRAINING S YSTEMS, STRATEGIES, AND PRACTICES
Why do you think that some people show more self-control than others? How would we explain...
Why do you think that some people show more self-control than others? How would we explain this from a behavioral perspective (remember, think "environment", think "learning" - not character flaws)?
M&M described the relationship between capital structure and firm value, in a world with corporate taxes,...
M&M described the relationship between capital structure and firm value, in a world with corporate taxes, as follows: VL = VU + τD (where τ is the corporate tax rate and D is the firm’s amount of debt). Note that they also said VL = VU when there were NO corporate taxes. Explain what you think this formula says about the relationship between firm debt usage and firm value. Then explain one aspect of the real world that discourages firms...
Using your own words, explain how HMI can be used to control or monitor an industrial...
Using your own words, explain how HMI can be used to control or monitor an industrial process. Support your answer with examples of industries that commonly use HMIs.