There are 6 components of program structure, declarations, Input, Storage, Operation, Control and Output.
A declarations associates a group of variables with a specific data type. All variables must be declared before they can appear in executable statements. E.g
int height, weight;
float area;
char choice, name[25];
Input is a set of information called data that will be entered into the computer from keyboard, floppy disk, hard disk etc. and stored in a portion of the computer memory. This input which is an input to the computer will then be processed to produced the desired result.
Storage refers to every piece of information that are stored within the computer’s memory which is encoded as some unique combination of zeros and ones. Computers also employ auxiliary storage e.g. disks in addition to their primary memories which allowed information to be stored permanently and can be physically disconnected when not in use.
Operation is how the program will run. There are two ways of Operation :
i. Batch mode
The program and the data are typed into the computer and stored within computer’s memory and processed in its proper sequence. Large quantities of information can be transmitted into and out of the computer without the user present while the job being processed. Batch processing can be undesirable for simple jobs.
ii. Interactive mode
The user and the computer are able to interact with each other during computational session.
Control refers to the order of execution of instructions in a program. The instruction can be executed
i. sequentially – one by one
ii. from top downwards or
iii. non sequential execution
Most real life problems require some kind of decision making to take a certain course of action. This means that instruction or a whole block of instructions can be executed, repeated or skipped.
Output refers to the processed data which produced certain result. The output data will be presented in a sheet of paper through the printer or display on a monitor.
No comments:
Post a Comment