Program Design Model
Event-Driven Programming
Event-Driven Programming uses a graphical interface in programming. In this type of programming, when the user instructs the computer with the help of a keyboard or mouse in various parts with the help of a graphical interface, it is called an event. When a command button is clicked by the mouse, its associated actions are performed. These functions are called procedures. Event Dryden like Procedural Programming
Characteristics of a Standard Program:
Programming is required to perform tasks that cannot be performed using conventional application software. A programmer has to have a clear and practical understanding of the programming language or it is impossible to write ideal programs. Also, a programmer needs to be well aware of the purpose of programming. An ideal program should have the following features.
(1) The program should be as short as possible.
(2) Variables and constants used in the program must be declared at the beginning of the program.
(3) Excessive loops in the program should be avoided.
(4) Flowcharts and algorithms used for the program should be extremely simple.
(5) Variable names used in programs should be meaningful.
(6) Appropriate programming language should be selected for the particular task.
(7) Selecting the appropriate algorithm for a particular task.
'C' Programming Language: C is a type of high-level language. It is a structured programming language. US Bell Labs programmer Dennis Ritchie created the C programming language in 1970. At first, the C programming language had to be used in the Unix operating system for the PDP-11 computer. The Unix operating system was later rewritten by C. Currently, C programming language is used to control various computers and various operating systems.
Primary Concept Due to the popularity of C, various software companies develop C compilers. Some common compilers are Turbo C, Borland C, Microsoft C etc. There are minor differences between these versions of C. With few exceptions, programs written in one version can be executed in another version. More than 90 per cent of compilers and operating systems in use today are written in C language. The use of a function called Main is essential in C programs. Program execution starts from this function.
The process to start a C program: Most C compilers have their own advanced source editor, where C source files can be created easily and beautifully. The Turbo C compiler has an integrated environment called the Turbo C IDE (Integrated Development Environment). To run the IDE, the TC.Exe file is run from the BIN subdirectory of the C compiler directory. Then select New from the File menu to write the program. Whether a new file is opened as NONAME00.CPP or NONAME00.C is specified in the Environment submenu Editor option of the compiler's options menu. This option can be changed if necessary.
C programming language has the following features:
1. In the C programming language header file is mentioned at the beginning of every program.
2. The main() function should be written after the header file.
3. Instructions used by the program must be enclosed in second parentheses ( ).
4. Comment line used by the program should be given // at the beginning. If the comment is multiple lines. /* and */ must be enclosed within these symbols.
5. Statements in the C program language must be in English lowercase.
6. It has the convenience of using various library functions.
7. C programming language is not machine dependent.
Program Compile:
After creating the source program, its execution has to be done in two steps; Namely:
(1) (.obj) file is created when the program is compiled (Alt+F9).
(2) When the program is executed (Ctrl+F9) (.exe) file is created.
* Monitoring program results
Press F7 to trace the source program step by step. So press Ctrl+F2 to stop monitoring the program.
Comments
Post a Comment