0% found this document useful (0 votes)
21 views

Programing in Visual Basic 2010 25

The document discusses the fundamentals of designing and programming for computers. It explains that computers follow precise directions and that providing instructions in a language they understand is called programming. It notes that algorithms are descriptions of programs that can range from general to precise depending on the level of detail needed. The document outlines that for a computer, the algorithm describes the steps, decisions, and repetitions needed to solve a problem. Programmers must be able to describe even simple processes in minute, incremental steps that the computer can understand.

Uploaded by

mudassir2640
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Programing in Visual Basic 2010 25

The document discusses the fundamentals of designing and programming for computers. It explains that computers follow precise directions and that providing instructions in a language they understand is called programming. It notes that algorithms are descriptions of programs that can range from general to precise depending on the level of detail needed. The document outlines that for a computer, the algorithm describes the steps, decisions, and repetitions needed to solve a problem. Programmers must be able to describe even simple processes in minute, incremental steps that the computer can understand.

Uploaded by

mudassir2640
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

5

Fundamentals of Design and Programming Starting from Scratch

Following Directions
Computers are great at following directions. Unlike teenagers and cats, they do
exactly what you tell them to do. All you need to do is provide them with precise
directions for the task and provide these directions in a language the computer
will understand. Thats the programming part. Of course, if the directions are
wrong, then the computer makes mistakes. Thats the source of those milliondollar utility bills. Proper planning helps to avoid these problems, but even
the best programs can still have mistakes in them. To minimize these mistakes,
programmers need to learn the fundamentals for writing programs.
You need to have a plan for developing a set of directions for the computer: a
program. This plan is commonly called an algorithm. An algorithm is a description of a program. Some algorithms are just a general description of the program.
Some are very precise. It just depends on the amount of detail needed for the
directions. For a vacation, youd be perfectly happy with a set of directions that
told you to drive to the airport, catch a flight to your destination, hop a cab to
your hotel, and then enjoy yourself. Thats a good general algorithm, but for each
of these, youd need a more specific algorithm. Youd need specific directions to
the airport. Youd need to know the flight, its airline, the gate, and the departure
time. Once you arrive, youd need to be able to get to the hotel and, once youve
checked-in, youd want a list of sights and shows. All of these steps require more
precise directions.
For the computer, the description of the steps to solve the problem becomes
the algorithm. With it, a programmer decides the sequence of steps, the decisions
that must be made, and the steps that need to be repeated. These directions
are miniscule, incremental, and precise. On the computer, even the simplest
task often takes considerable programming. Processes (thinking) that you have
internalized things that come almost automatically for you have to be fully
described for a program. If asked to give the largest number in a set of three
numbers, you could solve that without thinking. Youd have it completed
within a split second of knowing the numbers. The real trick is to be able to
describe the process you used to solve the problem and then translate that
process into computer directions. Youll see more of this process in Chapter 5
on decisions. For now, it suffices to describe the process in general terms. First
youd declare the space thats needed for data. In this case, its the numbers
youre comparing. The second step is to get the numbers into the computer
the input step in the process. The processing step involves comparing the first
number to the second number. Keep the higher of the two. To store it requires a
storage space for the data. Then compare that number to the third and keep the
higher of those two. Once completed, the computer would know the highest
number in the list.

You might also like