HPlogo Understanding Your System: HP 3000 Series 9X8LX Computer Systems > Chapter 1 What Is a Computer?

How Do Programs Do What They Do?

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

If you have ever followed a recipe to cook a meal, or assembled something using printed instructions, you have gone step by step through a sequence of instructions, much the way a computer goes step by step through a program.

Mama's Nice, Simple Tomato Sauce

Ingredients

  • fresh tomatoes, 3 or 4, cut up (peeled and seeded, if you wish). Save the juice.

  • olive oil, one tablespoon

  • garlic, one clove, minced

  • onion, one-half, diced

  • fresh basil, two or three leaves

  • salt and pepper to taste

Directions

  1. Warm the oil in a heavy pan or skillet.

  2. Add garlic and onion, cook gently until onions are translucent.

  3. Add tomatoes, tomato juice, and basil.

  4. Add salt and pepper to your liking.

  5. Simmer and allow the liquid to reduce.

  6. Taste and correct the seasonings.

  7. Serve over hot, cooked pasta.

Everything you need to know in order to prepare this sauce is given in this recipe: what you need to buy, what you need to do. Computer programs do for computers what recipes do for cooks—organize information and provide instructions for carrying out tasks.

Sometimes these instructions are no more complex than following a sequence of unchanging steps. More complicated methods require analysis and decision.

  • "If the cost of production exceeds revenues by 2 percent in any three consecutive months...."

  • "While lemons are on sale, buy lemons and make pies...."

  • "Buy lemons and make pies until the price of lemons has increased by 6 percent..."

Feedback to webmaster