answersLogoWhite

0

We try to generalise our code as much as we can. We cannot avoid using values completely, however a value is a literal constant and if we use the same constant over and over it makes sense to use a named constant variable rather than a value, if only to make it much easier to change the value throughout our code.
To use a real world example, suppose we are writing a Sudoku solving program. The value 9 crops up quite a lot because there are 9 rows, 9 columns, 9 boxes and 9 digits, one of which is the digit 9. However, Sudoku is not a number puzzle, we just use digits for notational convenience. Any 9 unique symbols would do, so using variables instead of values would give us the ability to change symbols.

Moreover, Sudoku puzzles are not just limited to 9 rows, columns and boxes, we can use any number that is a square. 9 is the square of 3 thus a standard Sudoku has order 3. We can also use order 2 (a 4x4 Sudoku), order 4 (a 16x16 Sudoku) and so on. The size of the Sudoku does not change the logic of solving it, so by using a variable to keep track of the order we can cater for any size Sudoku without changing the code. Our code becomes more generalised (less detailed) because it no longer focuses on a standard Sudoku.
User Avatar

Wiki User

8y ago

What else can I help you with?

Continue Learning about Engineering

Are there any personal characteristics which might be advantageous in engineering but disadvantageous in managerial job?

Narrowness of focus: While attention to detail and ability to focus are assets in both areas, a managerial position may often require a broader outlook that, in an engineering position might be seen as lack of focus or detail - but in a management position is seen as seeing the broader picture.


Who rebuilds variable control relay modules?

Variable control relay modules are typically rebuilt by specialized electronic repair companies or service providers that focus on industrial automation and control systems. These companies often have technicians with expertise in electronics and the specific components used in relay modules. Additionally, some manufacturers of the original equipment may offer rebuilding services or provide replacement modules. It's important to choose a reputable service provider to ensure quality and reliability in the rebuilt modules.


Where do images come into focus?

For people who are farsighted, images come into focus behind the retina; for people who are nearsighted, images come into focus in front of the retina.


What does focus mean in VBA?

Well, focus does exactly what you'd think it does: For example, If I would say, "TextBox1.Focus," it would place the user's cursor in the textbox. This means that we've focused on TextBox1, and can then edit it's text etc.


What is micro focus cobol?

Find about microfocus Cobol at below link http://www.applicationporting.org/2013/05/what-is-micro-focus-cobol.html#.UaLwfaIwfMk

Related Questions

What does your life is frittered away by detail means?

It means instead of enjoying something, you focus on the little details.


What is a septic focus?

The attention to a detail without any focus on its relation within the wider system that it operates.


Which is NOT a way that an entrepreneur could increase the contribution margin or profit of each unit sold?

One way an entrepreneur cannot increase the contribution margin or profit of each unit sold is by increasing variable costs, such as production or material expenses. Higher variable costs directly reduce the contribution margin, as they increase the cost associated with each unit sold. Instead, entrepreneurs should focus on reducing these costs or increasing the selling price to improve profitability.


What is the variable that social scientist call the casual variable that brings about change?

The variable that social scientists refer to as the causal variable is the one that is believed to directly influence or cause changes in another variable. This variable is often the focus of research and analysis to understand its impact on the outcome of interest.


How do you pick out independent variables and dependent variables?

An Independent variable is what you control; you decide the focus of your experiment and what you control on the independent variable. Dependent variable is what you want to look at or find results for; you decide what you want to see from manipulating your independent variable.


How do telescope Works?

Mirrors and lenses in telescopes bend and focus light to produce an image with more detail.


What is a variable being measured?

A variable being measured is a characteristic or attribute that can take on different values or levels, and it is the focus of study in research or experimentation. Variables can be either independent (manipulated or controlled by the researcher) or dependent (affected by changes in the independent variable).


How do you replace the alternator on a 1999 Ford Focus Ztec?

loo on www.focushscks,com they have the full detail on how to.


What are the benefits of an automated billing system?

There are many benefits to using an automated billing system. Some of which include the ability to reduce the size of staff involved in the billing process which would reduce salary expense. In addition, it could also allow staff members to focus their attention on other activities instead.


What are the top foods to avoid in order to reduce inflammation in the body?

Foods high in sugar, processed foods, and trans fats should be avoided to reduce inflammation in the body. Instead, focus on a diet rich in fruits, vegetables, whole grains, and healthy fats like those found in nuts and seeds.


Does the dependent variable change because of the independent variable?

Yes, the dependent variable is the one that is being measured or tested in an experiment, and its values are expected to change in response to manipulations of the independent variable. The relationship between the independent and dependent variables is the main focus of a scientific study.


On what economic activities did the europeans focus instead?

great bristish