answersLogoWhite

0


Best Answer
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

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does the use of a variable instead of a value help to reduce detail and focus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.


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.


If you want to see something in fine detail you should focus light in what part of your retina?

Your Fovea


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.


On what economic activities did the europeans focus instead?

great bristish


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.


Is the primary element that distinguishes tactical market research from strategic market research?

The level of focus and detail of the research


Why so you think that it is a good idea to limit an experiment to test only one variable at a time whenever possible?

because you can focus more on the only variable you need in an expirement and get the results accuratly


Rate the attacks of my lv 90 Infernape Focus Punch Fire Blast Flare Bltiz and Flamethrower?

Your moves are very good. But for focus punch instead you can put focus blast. Instead of flare blitz you can put blast burn or a non fire or fighting type move.