Question: Define a program as described in this chapter. How does it function In the chapter it describes the following: A program is a set of

Define a program as described in this chapter. How does it function

In the chapter it describes the following:

A program is a set of ordered instructions created to accomplish a specific task. Based on that definition, many everyday life activities can be seen as programs.

A basic recipe for bread can be seen as a program:

Preheat oven to 375 F. Prepare two 9-inch loaf pans by buttering and lightly flouring.

  • Dissolve yeast in warm water. Add sugar, salt, oil, and 3 cups of water.
  • Beat until smooth and stir in remaining flour.
  • Knead on a floured surface for 8 - 10 minutes.
  • Place in greased bowl and let rise for 1 - 2 hours.
  • Punch dough down, divide in half and place in loaf pans. Cover and let rise until doubled.
  • Bake at 375 F for 30 - 35 minutes.

In this example, the order of the instructions is relevant. The recipe, like a software program, was designed to accomplish a specific task, in this instance, to make bread. The recipe could have been written in any language; English, Portuguese, Chinese, or Arabic. The only requirement for the language choice is that the person who is to make the bread is able to understand the language. While different languages have different grammar rules and syntax, the recipe's logic should not change. Similarly, computer programs are also a set of ordered instructions created to accomplish a specific task. Also called code, computer programs can be written in several different languages. The syntax and rules vary from language to language but the program's logic should have little to no change.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!