0% found this document useful (0 votes)
14 views12 pages

Software Development Theory

Computer programming languages, such as Visual Basic, C#, and Java, are governed by syntax rules that must be followed for correct interpretation by computers. Data in programming is organized hierarchically, with distinctions between numeric and character variables, and modularization allows programmers to break down complex problems into manageable units. The Software Development Life Cycle (SDLC) outlines the steps from understanding a problem to coding, testing, and maintaining programs, emphasizing the importance of structured programming and control structures.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views12 pages

Software Development Theory

Computer programming languages, such as Visual Basic, C#, and Java, are governed by syntax rules that must be followed for correct interpretation by computers. Data in programming is organized hierarchically, with distinctions between numeric and character variables, and modularization allows programmers to break down complex problems into manageable units. The Software Development Life Cycle (SDLC) outlines the steps from understanding a problem to coding, testing, and maintaining programs, emphasizing the importance of structured programming and control structures.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 12

Computer instructions are written in computer programming languages.

Examples of these languhages


include Visual Basic, C#, C++, Java, and COBOL. Programmers may work exclusively in one language or
know several and choose the most appropriate one for the task.

Every programming language has rules governing its word usage and punctuation, which are called its
syntax. For a computer to interpret a programming language instruction, the syntax must be perfect. If
the syntax is incorrect, the language translator software will let you know by displaying an error
message, making syntax errors relatively easy to locate and correct.

Each programming language uses a piece of software, called a compiler or interpreter, to translate the
specific programming language into the computer's on/off circuitry language, or machine language. The
basic function of compilers and interpreters is to translate programming statements into code the
computer can use.

Programmers choose a particular language because some have built-in capabilities that make them more
efficient for certain types of operations. Despite their differences, programming languages are quite
alike, as each can handle input, arithmetic processing, output, and other standard functions. The logic
developed to solve a programming problem can be executed using any number of languages; the
programmer only needs to worry about syntax after a language is chosen.

Programming languages can be described as high-level or low-level. Machine language, made up of 1s


and 0s that the computer understands, is a low-level language. High-level programming languages are
English-like and allow programmers to use vocabulary where one broad statement corresponds to
dozens of machine instructions. Older programming languages required programmers to work with
memory addresses and memorise awkward codes associated with machine languages. Newer
programming languages look much more like natural language and are easier to use, partly because they
allow programmers to name variables instead of using awkward memory addresses and provide means
to create self-contained modules. Newer languages such as C#, C++, and Java also enforce structure.

The sources do not provide a specific ranking of programming languages, but they distinguish between
older, less structured, lower-level languages and newer, structured, high-level languages that are easier
for programmers to use.

Data Types Involved in Programming

When data items are stored for use on computer systems, they are organised in a data hierarchy. This
hierarchy includes characters, fields, records, files, and databases.

Characters are letters, numbers, and special symbols. They are made up of bits, but most computer users
don't need to care about bits.


A field is a single data item, such as a last name, street address, or annual salary.

•`

Records are groups of related fields that go together for some logical reason.

Files are groups of records that go together for some logical reason.

A database holds a group of files, often called tables, and contains many files.

Every programming language requires programmers to distinguish between numeric and character
variables, as computers handle these two types of data differently. When you declare a variable, you
must provide a name and a data type. The data type tells the computer which type of data to expect.
The operating system uses the type (such as num or char) to determine how to store the information, as
numeric and character values are stored in different formats.

Some programming languages allow for several types of numeric data. For example, languages like C++,
C#, Visual Basic, and Java distinguish between integer (whole number) numeric variables and floating-
point (fractional) numeric variables that contain a decimal point. While some languages allow even more
specific variable types, the distinction between character and numeric data is universal. Character data
values are typically included within quotation marks.

Modularization

Programmers seldom write entire programs as one long series of steps. Instead, they break down
programming problems into smaller, reasonable units called modules. These units are also referred to as
subroutines, procedures, functions, or methods, with the specific term often reflecting the programming
language being used (e.g., "procedure" in Visual Basic, "function" in C/C++, "method" in C#/Java). The
process of breaking a large program into modules is called modularization.

Although not strictly required, there are at least four reasons to use modularization:

Abstraction: Modularization provides abstraction, which is the process of paying attention to important
properties while ignoring nonessential details. This allows programmers to see the "big picture".

Multiple Programmers: Modularization allows a large task to be divided among various people or
programming teams, enabling professional software developers to write new programs more quickly.


Reusability: Modularization allows programmers to reuse their work. Once a useful module is created, it
can be reused in many different programs, either by copying its definition or, in modern languages, by
storing it in a separate file and including it as needed.

•i

Control Structures in Programming

A structure is a basic unit of programming logic. Mathematicians proved that any program, regardless of
complexity, can be constructed using one or more of only three basic structures: sequence, selection,
and loop.

A sequence structure performs actions or tasks in order, one after the other. There is no branching off or
skipping tasks; once a sequence starts, you must continue step-by-step until it ends. A sequence can
contain any number of tasks.

A selection, or decision, structure involves asking a question and taking a different action based on the
answer. This is also referred to as an if-then-else structure. Selection structures can be dual-alternative
(two possible paths) or single-alternative (one path or skip). Decisions involve evaluating Boolean
expressions using relational comparison operators like >, <, >=, <=, =. Complex conditions can use AND or
OR logic.

A loop, also known as repetition or iteration, is a structure that repeats actions while some condition
remains true. A while loop specifically continues while some condition is true. The set of statements
executed within a loop is called the loop body. A structured loop can only be exited at the point where
the condition testing the loop control variable occurs.

These three basic structures can be combined in an infinite number of ways. Combining them end-to-
end is called stacking structures. Placing one structure within another is called nesting the structures.
Any structure (sequence, selection, or loop) can contain other sequences, selections, or loops.

A fundamental characteristic of structured programming is that each structure has one entry and one
exit point. Structures can only attach to one another at these points. Structured programming avoids
spaghetti code, which is snarled, unstructured program logic. Structured programs are generally easier to
write, understand, and maintain.

In addition to the three basic structures, many programming languages allow three special structures:
the case structure and the do-while and do-until loops. These are never strictly needed to solve any
problem, as they can be replicated using combinations of the basic structures (a series of selections for a
case structure, a sequence plus a while loop for do-while/do-until). The case structure tests a variable
against a series of values. The do-while and do-until loops are post-test loops, meaning the condition is
tested after the loop body has executed. Many languages allow one type of post-test loop or the other.

A block is a group of statements that execute as a single unit. When loops are placed within loops, they
are called nested loops, with an outer loop containing an inner loop. Each nested loop requires its own
loop control variable that must be initialized, tested, and altered at the appropriate time.

Software Development Life Cycle (SDLC)

The sources mention the Software Development Life Cycle (SDLC) as a concept for equipping students
with knowledge of key phases. The programming process described in the sources closely aligns with the
phases typically found in an SDLC model.

A professional programmer's job involves a series of steps:

1.

Understanding the problem: Programmers write programs to satisfy the needs of others, so
understanding the problem they need to solve is the most important step before planning logic.

2.

Planning the logic: This involves determining the steps needed to solve the problem and their order. This
is also called developing an algorithm, which is the sequence of steps necessary to solve any problem.
Common tools for planning logic are flowcharts and pseudocode. At this stage, the programmer focuses
on the sequence of events from input to output, not the syntax of a specific language. Desk-checking,
walking through the logic on paper, is part of this step.

3.

Coding the program: Only after the logic is developed does the programmer write the program in a
programming language. This is also known as writing the actual instructions. The programmer must then
worry about correct syntax.

4.

Using software to translate the program into machine language: After coding, a compiler or interpreter
translates the programming language into the computer's machine language (1s and 0s). This step also
identifies syntax errors.

5.

Testing the program: Once the program is translated, it must be tested to ensure it produces the desired
results and handles various scenarios correctly. Testing helps find logical errors (semantic errors), which
occur when the syntax is correct but the logic performs incorrect instructions or operations.

6.
Putting the program into production: If the program's syntax and logic are correct, it can be put into
production, meaning it is used for the intended purpose.

The sources also suggest that maintaining programs, making required changes after they are in
production, could be considered a seventh step in the programming process.

The overall logic, or mainline logic, of most procedural computer programs follows a general structure
that can be broken down into three distinct parts or modules:

1.

Housekeeping or initialization tasks: Steps performed at the beginning to get ready. These typically
include declaring variables, opening files, performing one-time tasks like printing headings, and reading
the first input record (priming read).

2.

Main loop: Contains the instructions executed repeatedly for every record until the end of the input (eof)
is reached.

3.

End-of-job routine: Steps taken at the end of the program after all input records are processed. Typical
tasks include printing summaries, grand totals, or final messages, and closing all open files.

Breaking the program into these three main procedures (modules) helps keep the job manageable,
allows tackling large jobs one step at a time, and aids in keeping the program structured. This breakdown
aligns with the planning and design phases mentioned in the SDLC.

I want to study for my text and get an A+

Drawing on the information within the provided study guide excerpts, here is a detailed summary of
programming languages, data types, modularization, control structures, and the programming process
(akin to aspects of the SDLC) to aid in your studies.

Programming Languages

Computer instructions are written in computer programming languages. Examples of these languages
include Visual Basic, C#, C++, Java, and COBOL. Programmers may specialise in one language or know
several, choosing the most appropriate one for a given task.

Every programming language is governed by rules for word usage and punctuation, which constitute its
syntax. For a computer to understand an instruction, the syntax must be perfect; if incorrect, the
language translator software will indicate a syntax error with an error message, making these errors
relatively easy to identify and fix.
Each programming language requires software called a compiler or interpreter to translate the
programming language into the computer's native language, known as machine language, which is
composed of 1s and 0s. The fundamental purpose of compilers and interpreters is to perform this
translation.

Programmers choose languages based on their built-in capabilities that make certain operations more
efficient. Despite their differences in syntax and features, programming languages are fundamentally
similar in their ability to handle input, arithmetic processing, output, and other standard functions. The
underlying logic devised to solve a programming problem can be implemented using various languages;
the programmer only needs to focus on the specific language's syntax after the logic is complete.

Programming languages are categorised as high-level or low-level. Machine language is considered a


low-level language. High-level programming languages are English-like, enabling programmers to use
statements where one broad statement can correspond to many machine instructions. Older languages
often required dealing with memory addresses and less intuitive codes. Newer languages are more akin
to natural language, allowing the naming of variables and the creation of self-contained modules, and
languages like C#, C++, and Java also enforce structure.

The sources do not provide a specific ranked list of programming languages. However, they implicitly
rank them by distinguishing between older, less structured, lower-level languages and newer, structured,
high-level languages that are easier for programmers to use and manage.

Data Types Involved in Programming

Data items used on computer systems are organised in a data hierarchy. This hierarchy progresses from
smaller to larger units:

Bits: The smallest elements, forming characters. Most users don't need to worry about bits.

Characters: Letters, numbers, and special symbols. Characters are made up of bits.

Fields: A single data item, such as a last name, street address, or annual salary. Fields are groups of
characters.

Records: Groups of related fields that are logically connected, like all the data for a single employee or
customer. Files contain records.


Files: Groups of records that belong together logically, like all employee records. Databases hold groups
of files.

Databases: A collection of files, often referred to as tables.

A crucial concept is that every programming language requires programmers to distinguish between
numeric and character variables. Computers process these data types differently. When you declare a
variable, you must provide a name and a data type. The data type informs the computer what kind of
data to expect. The operating system uses the declared type (e.g., num or char) to determine the
appropriate storage format.

Some programming languages offer multiple numeric data types. For instance, languages like C++, C#,
Visual Basic, and Java differentiate between integer (whole number) and floating-point (fractional,
containing a decimal point) numeric variables. While even more specific types might exist in some
languages, the fundamental distinction between character and numeric data is universal. Character data
values are typically enclosed within quotation marks. Numeric variables hold numeric values, and
character, text, or string variables hold character values. Declaring a variable names the memory location
and specifies the data type.

Data values can also be constant. A numeric constant is a specific numeric value, while a string constant
(or character constant) is a string of characters enclosed within quotation marks.

Modularization

Programmers rarely write entire programs as one monolithic block of instructions. Instead, they divide
programming problems into smaller, manageable units called modules. These modules are also known as
subroutines, procedures, functions, or methods in various programming languages.

There are several important reasons for using modularization:

Abstraction: Modularization provides abstraction. Abstraction is the process of focusing on important


properties while intentionally ignoring nonessential details. It allows programmers to see the "big
picture" of the program.

Allows multiple programmers to work on a problem: Dividing a large task into modules enables different
programmers to work on separate parts concurrently. Large commercial programs are rarely written by a
single person.

Allows you to reuse your work: Modules can be designed to perform a specific task and then reused in
multiple programs or multiple times within the same program. Storing modules in separate files (using
commands like include, import, or copy depending on the language) facilitates reuse.

Makes it easier to identify structures: Modularizing a program makes it easier to discern and manage the
underlying control structures.

When one program or module uses another module, the former is referred to as the calling program (or
calling module) because it "calls" the module's name to execute it. The flowchart symbol for calling a
module is a rectangle with a bar across the top.

Variables can be declared with different scopes in modular programs. Local variables are declared within
a specific module and are typically only accessible within that module. Global variables are declared
once (usually at the beginning of the program) and are then available for use in all modules. Declaring a
variable involves giving it a name and specifying its data type.

The concept of functional cohesion relates to how well the statements within a module contribute to the
same single task. Higher cohesion is generally desirable. Module names often start with verbs like get,
compute, or print because modules perform actions. Clear variable and module names are important for
program readability and understanding.

Control Structures in Programming

Structured programming is based on the idea that any program logic, no matter how complex, can be
expressed using combinations of three fundamental control structures. Sticking to these structures is
recommended for reasons of clarity, professionalism, efficiency, and modularity. Logic that does not
follow these structures is sometimes referred to as "spaghetti code".

The three basic structures are:

1.

Sequence: This structure involves performing actions or tasks in a specific order, one after another. A
sequence can contain any number of tasks, and once started, you must proceed through each step
without skipping any.

2.

Selection (Decision): In this structure, you ask a question that has a true or false answer, and depending
on the answer, you follow one of two possible paths of action. After executing the actions in the chosen
path, you continue with the next task in the program's overall logic. This structure is also known as an if-
then-else because it fits the pattern "if a condition is true, then do this, else (otherwise) do that".

A dual-alternative selection (or binary selection) has actions specified for both the true and false
outcomes of the condition.

A single-alternative selection (or unary selection or if-then) specifies actions only for the true outcome;
no action is taken if the condition is false. The branch where no action is taken is called the null case.

Decisions are made using Boolean expressions, which evaluate to either true or false. These expressions
use relational comparison operators like =, >, <, >=, <=, and != (not equal to) to compare values. Any
logical comparison can be expressed using just equal to, greater than, and less than, but the others are
often more convenient.

AND logic involves situations where two or more conditions must all be true for a resulting action to
occur. The sources discuss how the order of checking conditions in an AND decision can impact
efficiency, especially in nested structures. A common error is not ensuring that the second decision in a
nested AND structure is entirely contained within the first. Another is attempting incomplete Boolean
expressions when using the AND operator.

OR logic involves situations where at least one of two or more conditions must be true for a resulting
action to occur. Similar to AND, the order of checking conditions can affect efficiency; checking the more
likely condition first can reduce the number of subsequent checks. A common error is creating
unstructured logic when trying to combine the actions. Errors can also occur when dealing with ranges,
where casual English use of "or" might translate incorrectly into logic.

AND and OR operators can be combined in expressions. By default, AND operators have precedence over
OR operators, meaning they are evaluated first. Parentheses can be used to force a different order of
evaluation.

Decision tables are a tool used in planning selection structures, mapping conditions to the actions that
should be taken.

3.

Loop (Repetition): This structure allows you to repeat a set of actions based on the answer to a question.
The loop continues as long as (or until) a specific condition is met.


Loops require a mechanism to control how many times they execute, often using a loop control variable.
This variable is typically tested in the loop condition.

A counter is a numeric variable used to keep track of the number of times an event (like a loop iteration)
has occurred.

A loop can be controlled by a sentinel value (also called a dummy value or limit value), which is a
preselected value that indicates it is time to stop the loop. This value can be a constant or a variable.

A common technique in structured loops that process files is the priming read (or priming input), which
reads the first data record before the loop begins. Subsequent records are read within the loop.

An infinite loop is a repeating flow of logic that lacks a proper ending condition.

Loops can be controlled by incrementing (increasing) or decrementing (decreasing) the loop control
variable.

Nested loops occur when one loop structure is placed inside another.

The sources mention Do-While and Do-Until as special loop structures. These are posttest loops,
meaning the loop condition is checked after the loop body has executed at least once. A standard While
loop is a pretest loop, checking the condition before executing the loop body. Any posttest loop can be
replicated using a sequence followed by a pretest while loop. The choice often depends on preference.

An early exit from a loop occurs when the search or processing within a loop is stopped as soon as a
desired condition is met (e.g., finding a match in an array). This improves efficiency.

Structures can be combined by stacking them (attaching them end-to-end) or nesting them (placing one
structure inside another).

The Programming Process (Relevant to SDLC)

The sources describe the steps involved in creating a computer program, which align with aspects of the
Software Development Life Cycle (SDLC), although the term "SDLC" is not explicitly used. The process
outlined is a linear sequence of tasks a programmer performs.

The key steps described are:

1.

Understand the problem: The programmer must first fully grasp the task the program needs to
accomplish. This involves understanding the requirements and the desired output.

2.

Plan the logic: This is a critical step where the programmer determines the sequence of steps (algorithm)
necessary to solve the problem. Planning involves thinking about all possible data values and how the
program should handle each scenario. Desk-checking is the process of manually walking through the
program's logic on paper using sample data before writing the code. Good planning and design are
essential, especially for larger, more complex programs.

3.

Code the program: Only after the logic is planned should the programmer write the actual program
statements in a chosen programming language (coding). The choice of language depends on its
suitability for the task.

4.

Translate the program: The code written in the programming language must be translated into machine
language using a compiler or interpreter.

5.

Test the program: Once the program is free of syntax errors, it is executed with sample data to check for
logical errors (also called semantic errors). Logical errors occur when the instructions are syntactically
correct but produce incorrect results. Programs should be tested thoroughly with multiple sets of data.

6.

Put the program into production: After adequate testing, the program is ready for use by the
organisation or user (client). This could be a simple one-time execution or a lengthy implementation
process.

The sources also discuss program design principles such as:

Structuring the program using sequence, selection, and loop.


Using modularization to break down the program.

Planning the mainline logic, which is the overall flow of the program from beginning to end.

Identifying typical program components like a housekeeping module (for initial tasks like variable
declarations, opening files, printing headings), a main loop (where the primary processing happens), and
an end-of-job module (for final tasks like closing files).

Handling file processing, including reading input (potentially using group names for convenience),
checking for the end of the file (eof), writing output, merging files, matching files, and updating records
in sequential files.

Employing good programming habits such as using meaningful variable and module names, using named
constants where appropriate, avoiding confusing line breaks, and using temporary variables to simplify
complex calculations.

By understanding these core concepts in detail from the study guide, you should be well-prepared for
your test and increase your chances of achieving a high grade like an A+. Remember to practice applying
these concepts through exercises like the ones suggested in the guide.

You might also like