[Latest News][6]

Computer Science
General
Life's Internal Structure
Popular Theories
Scientists Biography
Techhacks
Technical
Technology

Search This Blog

Computer Program - Work and design


Hi,Computers don't do anything without someone telling them what to do, much like the average teenager. To make the computer do something useful, you must give it instructions in either of the following two ways:
  • Write a program that tells a computer what to do, step by step, much as you write out a recipe.
  • Buy a program that someone else has already written that tells the computer what to do.
Ultimately, to get a computer to do something useful, you (or somebody else) must write a program.
A program does nothing more than tell the computer how to accept some type of input, manipulate that input, and spit it back out again in some form that humans find useful. Table 1 lists some common types of programs, the types of input that they accept, and the output that they produce.
Table 1 Input and Output for Various Programs
Programming is problem-solving
Essentially, a program tells the computer how to solve a specific problem. Because the world is full of problems, the number and variety of programs that people can write for computers is practically endless.
But to tell a computer how to solve one big problem, you usually must tell the computer how to solve a bunch of little problems that make up the bigger problem. If you want to make your own video game, for example, you need to solve some of the following problems:
  • Determine how far to move a cartoon figure (such as a car, a spaceship, or a man) on-screen as the user moves a joystick.
  • Detect whether the cartoon figure bumps into a wall, falls off a cliff, or runs into another cartoon figure on-screen.
  • Make sure that the cartoon figure doesn't make any illegal moves, such as walking through a wall.
  • Draw the terrain surrounding the cartoon figure and make sure that if the cartoon figure walks behind an object such as a tree, the tree realistically blocks the figure from sight.
  • Determine whether bullets that another cartoon figure fires are hitting the player's cartoon figure. If so, determine the amount of damage, how it affects the movement of the damaged cartoon figure, and how the damage appears on-screen.
The simpler the problem is that you need to solve, the more easily you can write a program that tells the computer how to work. A program that displays a simple Ping-Pong game with two stick paddles and a ball is much easier to write than a program that displays World War II fighter airplanes firing machine guns and dropping bombs on moving tanks while dodging anti-aircraft fire.
Programming isn't difficult; it's just time-consuming
Programming really isn't that difficult or mysterious. If you can write step-by-step instructions directing someone to your house, you can write a program.
The hardest part about programming is identifying all the little problems that make up the big problem that you're trying to solve. Because computers are completely stupid, you need to tell them how to do everything.
If you're giving a friend instructions to get to your house, for example, you may write down the following information:
1. Go south on Highway I-5.
2. Get off at the Sweetwater Road exit.
3. Turn right at the light.
4. Turn left into the second driveway.
Of course, if you try giving these instructions to a computer, the computer will get confused and wants to know the following additional information:
1. Where do I start and exactly how far south do I drive down Highway I-5?
2. How do I recognize the Sweetwater Road exit, and how do I get off at this exit?
3. After I turn right at the light, how far to the right do I turn, and do you mean the traffic light or the streetlight on the corner?
4. After I turn left into the second driveway, what do I do next? Park the car? Honk the horn? Gun the engine and accelerate through your garage door?

You need to tell computers how to do everything, which can make giving them instructions as aggravating and frustrating as telling children what to do. Unless you specify everything that you want the computer to do and exactly how to do it, the computer just plain won't do what you want it to do. 

About Author Science Catalysts

when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries.

No comments:

Post a Comment

Start typing and press Enter to search