Program: A Program Is A Specific Set of Ordered Operations For A Computer To Perform
Program: A Program Is A Specific Set of Ordered Operations For A Computer To Perform
PROGRAM
Computer program, a collection of instructions that performs a specific task when executed
by a computer.
A program is a specific set of ordered operations for a computer to perform.
2. PROGRAMMING
Programming is the process of creating a set of instructions that tell a computer how to
perform a task. Programming can be done using a variety of computer "languages," such as
SQL, Java, Python, and C++.
3. PROGRAMMING LANGUAGE
Each programming language has a unique set of keywords (words that it understands) and a
special syntax for organizing program instructions.
BASIC- Acronym for Beginner's All-purpose Symbolic Instruction Code. Developed by John Kemeney
and Thomas Kurtz in the mid 1960s at Dartmouth College, BASIC is one of the earliest and simplest
high-level programming languages. During the 1970s, it was the principal programming language
taught to students, and continues to be a popular choice among educators.
Despite its simplicity, BASIC is used for a wide variety of business applications. There is an ANSI
standard for the BASIC language, but most versions of BASIC include many proprietary extensions.
Microsoft's popular Visual Basic, for example, adds many object-oriented featuresto the standard
BASIC.
Recently, many variations of BASIC have appeared as programming, or macro, languages within
applications. For example, Microsoft Word and Excel both come with a version of BASIC with which
userscan write programs to customize and automate these applications.
C++, is a high-level programming language developed by Bjarne Stroustrup at Bell Labs. C++ adds
object-oriented features to its predecessor, C. C++ is one of the most popular programming language
for graphical applications, such as those that run in Windows and Macintosh environments.
JAVA- Java is a general purpose, high-level programming language developed by Sun Microsystems.
The Java programming language was developed by a small team of engineers, known as the Green
Team, who initiated the language in 1991.
Originally called OAK, the Java language was designed for handheld devices and set-top boxes. Oak
was unsuccessful and in 1995 Sun changed the name to Java and modified the language to take
advantage of the burgeoning World Wide Web.
Later, in 2009, Oracle Corporation acquired Sun Microsystems and took ownership of two key Sun
software assets: Java and Solaris.
4. STEPS IN PROGRAMMING
5 Steps Of Programming
Content
1 Clarify Programming Needs
2 Design the Program
3 Code the Program
4 Test the Program
5 Document and Maintain
Knowing the objective is the first consideration. Is it a payroll or editing program? Knowing who the
end user will be is also important. Determining the inputs and outputs is next. How will the program
operate and what data is needed to make it happen. After this has been decided feasibility is the
next consideration. How many programmers will it take, is the project within budget, does the
project have a realistic outline. Finally, if the project is a go, then one must take measures to ensure
the project is properly documented and analyzed.
Programs use algorithms which are like equations that tell the computer what task to perform. The
aim of the programmer is to create algorithms that are clear and simple. Algorithms are expressed
first in logical hierarchical form known as modularzation. Using modules or (a complete thought) the
programmer creates a logical thought process for the computer to follow. After that the program is
broken down in greater detail using pseudocode. Pseudocode uses terms like if, else, and, then to
relate the programs rules to the computer.
After the program has been designed it must be coded or written. Using the pseudocode and logic
requirements from step two an appropriate programming language must be selected. As stated in
the introduction, coding languages differ in specifications and usability. Once the appropriate code
language has been chosen, it is imperative that the programmer follow the syntax rules with as little
deviation as possible in order for the program to have high accuraccy.
After the program is written it then enters the programming debugging and testing phase of the
Program Development Life Cycle (PDLC). During this time the programmer will be looking for errors
in both logic and syntax, as well as exploring other areas that may cause the program to either not
work properly or to not run at all.
This process is a lengthy and tedious one, oftentimes consisting of up to 50% of a program’s time in
development (Morley 523). However, with a careful eye paid to program design and coding the
amount of time spent debugging can be cut considerably.
As stated, debugging will uncover errors in both logic and syntax. Syntax errors will prevent the
program from executing. They can be such simple things as misspelled words or can involve breaking
the syntax rules of the programming language used.
On the other hand, logic errors will allow the program to run but will provide incorrect results. Errors
of this kind may consist of merely using the wrong relational operator or other, larger, mistakes in
writing formulas.
Once the programmer locates the errors they are then fixed and the program is run again. This will
happen multiple times, often called “execute, check, and correct” (526), until the program runs
flawlessly.
Alpha testing is the process of reading through the program in search of errors in logic. The second
step is to run a diagnostic program to search for syntax or input errors.
Beta testing involves using the program in the real world to see if it contains any bugs or other
deficiencies.
Documentation should be ongoing from the very beginning because it is needed for those involved
with program now and future. Upon completion User Documentation for commercial use, Operator
Documentation for people who run computer systems, and Programmer Documentation for
programmers charged with maintenance.
5. COMPONENTS OF PROGRAMMING
Programming is somewhat like working with building blocks. Given enough children's toy blocks (and
enough time and ingenuity), you can build just about anything with only a few kinds of blocks. The
five basic elements in programming are:
Here, return_type is the type of value that the function will return. It can be int, float or any
user-defined data type.
function_name means any name that we give to the function. However, it must not resemble
any standard keyword of C++.
Finally, parameter_list contains a total number of arguments that need to be passed to the
function.
PARTS AND FUNCTION OF C++
C++ Functions
C++ functions are a group of statements in a single logical unit to perform some specific task.Along
with the main function, a program can have multiple functions that are designed for different
operation.The results of functions can be used throughout the program without concern about the
process and the mechanism of the function.
C++ Functions
In POP (Procedural Oriented Programming) language like C, programs are divided into different
functions but in OOP (Object Oriented Programming) approach program is divided into objects
where functions are the components of the object.
Function Prototype
Function Definition
Function Call
Thus, declaring a function before calling a function is called function declaration or prototype which tells the
compiler that at some point of the program we will use the function of the name specified in the prototype.
Syntax
return_type function_name(parameter_list);
Here, return_type is the type of value that the function will return. It can be int, float or any user-
defined data type.
function_name means any name that we give to the function. However, it must not resemble any
standard keyword of C++.
Finally, parameter_list contains a total number of arguments that need to be passed to the function.
C++ Function Call
Function call means calling the function with a statement. When the program encounters the function
call statement the specific function is invoked.
Syntax
function_name( argument_list );
Here, function_name is the name of the called function and argument_list is the comma-separated list
of expressions that constitute the arguments.
The syntax is similar to that of prototype except that return_type is not used.
Syntax
{function body};
Defining a function is a way of specifying how the operation is to be done when the function is called.