Вы находитесь на странице: 1из 8

VARIABLES AND STRUCTURES Common Conventions on writing Variables:

1. Camel casing - is the convention in which the


DECLARING AND USING VARIABLES
variable starts with a lowercase letter and any
Variables - are named memory locations whose contents subsequent word begins with an uppercase
can vary or differ over time. letter, such as hourlyWage.
2. Pascal casing - is a convention in which the first
Broad Data Types: letter of a variable name is uppercase, as in
1. Numeric – describes data that consists of HourlyWage.
number 3. Hungarian notation - is a convention in which a
2. String – Describes data that is nonnumeric variable’s data type is part of the identifier—for
3. Integer – whole number example, numHourlyWage or stringLastName
4. Floating-point – fractional numeric values that
contain a decimal point (real numbers) ASSIGNING VALUES
5. Numeric Constant – (Literal Numeric Constant) A 1. Assignment statement - assigns a value from the
specific numeric value because it does not right of an assignment operator to the variable
change or constant on the left of the assignment
6. String constant - (Literal string constant) A operator.
specific text value, or string of characters, such 2. Assignment Operator - is the equal sign; it is used
as “Amanda”. to assign a value to the variable or constant on
its left.
Data item’s data type- is a classification that describes 3. Binary operator - is an operator that requires
the following: two operands—one on each side
–What values can be held by the item
–How the item is stored in computer memory set someNumber = 2
–What operations can be performed on the data item. set someNumber = 3 + 7
set someOtherNumber = someNumber
Before writing a program: set someOtherNumber = someNumber * 5
–Have a thorough understanding of the problem
– Carefully plan an approach for solving it UNDERSTANDING THE DATA TYPES OF VARIABLES
1. Numeric variable - is one that can hold digits and
While writing a program: have mathematical operations performed on it.
– Know what “building blocks” are available 2. String variable - can hold text, such as letters of
–Use good programming principles the alphabet, and other special characters, such
as punctuation marks
Declaration - is a statement that provides a data type 3. Type-safety - is the feature of programming
and an identifier for a variable. languages that prevents assigning values of an
Identifier - is a program component’s name incorrect data type.
Example:
Initializing the variable - declaring a starting value • taxRate = 2.5
Example: • inventoryItem = "monitor
• num mySalary
• num yourSalary = 14.55 UNDERSTANDING THE CONCEPTS OF MODULARZATION
• string myName 1. Modules - are small program units that you can
• string yourName = "Juanita" use together to make a program. Programmers
• Garbage - a variable’s unknown value. also refer to modules as subroutines,
procedures, functions, or methods.
2. Modularization - the process of breaking down a
large program into modules is modularization;
computer scientists also call it functional • Continue to maintain good programming habits as you
decomposition develop your programming skills.
• Program comments - are written explanations that are
Reasons: not part of the program logic but that serve as
1. Modularization provides abstraction - they documentation for readers of the program
enable a programmer to see the “big picture.”
Abstraction is the process of paying attention to
important properties while ignoring UNDERSTANDING CONTROL STRUCTURES
nonessential details. 1. Algorithms
2. Modularization allows multiple programmers to • Computing problems – All can be solved by executing a
work on a problem – When you dissect any large series of actions in a specific order
task into modules, you gain the ability to more • Algorithm: procedure in terms of – Actions to be
easily divide the task among various people. executed – The order in which these actions are to be
3. Modularization allows you to reuse work more executed
easily - If a module is useful and well written, you • Program control – Specify order in which statements
may want to use it more than once within a are to executed
program or in other programs.
2. Pseudocodes
MODULARIZING THE PROGRAM Pseudocode
– Artificial, informal language that helps us develop
When you create a module, you include the following: algorithms
• A header—The module header includes the module – Similar to everyday English
identifier and possibly other necessary identifying – Not actually executed on computers
information. – Helps us “think out” a program before writing it
• A body—The module body contains all the statements • Easy to convert into a corresponding C++
in the module. program
• A return statement—The module return statement • Consists only of executable statements
marks the end of the module and identifies the point at
which control returns to the program or module that Control Structures
called the module. • Sequential execution – Statements executed one after
the other in the order written
UNDERSTANDING THE MOST COMMON • Transfer of control
CONFIGURATION FOR MAINLINE LOGIC – When the next statement executed is not the next one
1. Housekeeping tasks - include any steps you must in sequence
perform at the beginning of a program to get – Overuse of goto statements led to many problems
ready for the rest of the program. • Flowchart
2. Detail loop tasks - do the core work of the –Graphical representation of an algorithm
program. When a program processes many –Drawn using certain special-purpose symbols
records, detail loop tasks execute repeatedly for connected by arrows called flowlines –Rectangle symbol
each set of input data until there are no more (action symbol):
3. End-of-job tasks - are the steps you take at the •Indicates any type of action
end of the program to finish the application –Oval symbol:
• Indicates the beginning or end of a program or
FEATURES OF A GOOD PROGRAM DESIGN a section of code
• Use program comments where appropriate. • Single-entry/single-exit control structures – Connect
• Choose identifiers thoughtfully. exit point of one control structure to entry point of the
• Strive to design clear statements within your programs next (control-structure stacking)
and modules. – Makes programs easy to build
• Write clear prompts and echo input.
The if Selection Structure
Selection structure:
– Used to choose among alternative courses of action
– Pseudocode:
If student’s grade is greater than or equal to 60
Print “Passed”

If condition true
– Print statement executed and program goes on to next
statement
– If false, print statement is ignored and the program
goes onto the next statement
– Indenting makes programs easier to read

The if Selection Structure


• if structure is a single-entry/single-exit structure true
false grade >= 60 print “Passed” A decision can be made
on any expression. zero - false nonzero - true Example: 3
- 4 is true

The if/else Selection Structure


• If – Only performs an action if the condition is true
• if/else – Specifies an action to be performed both when
the condition is true and when it is false
• Pseudocode:
If student’s grade is greater than or equal to 60
Print “Passed”
Else
Print “Failed”

Nested if/else structures


– Test for multiple cases by placing if/else selection
structures inside if/else selection structures
–Once condition is met, rest of statements skipped
–Deep indentation usually not used in practice
OVERVIEW OF COMPUTERS AND LOGIC code,” or sentences that appear to have been written in
a computer programming language but do not
Computer System - a combination of all the components necessarily follow all the syntax rules of any specific
required to process and store data using a computer. language.
Every computer system is composed of multiple pieces - Involves writing down all the steps you will use
of hardware and software. in a program

Hardware – is the equipment, or the devices, associated • Flowchart - is a pictorial representation of the logical
with a computer. For example, keyboards, mice, steps it takes to solve a problem.
speakers, and printers are all hardware. • IPO (Input, Process, Output)
• TOE Charts (Tasks, Objects and Events)
Software - or programs, instructions that tell the • Desk-checking – the process of walking through a
computer what to do program’s logic on paper before you actually write a
• Application Software – comprises all the program.
programs you apply to a task – word processing • Algorithm - is the sequence of steps necessary to solve
programs, spreadsheets, payroll and inventory programs any problem
and even games.
• System Software – comprises that programs 3. Coding the program – despite differences among
that you use to manage your computer – including programming languages-each can handle input
operating systems, such as Windows, LINUX operations, arithmetic processing, output
operations, and other standard functions
MAJOR OPERATIONS OF HARDWARE AND SOFTWARE 4. Using software to translate the program into
• Input machine language
• Processing – data items that involves organizing,
checking for accuracy or performing mathematical Syntax error – misuse of a language’s grammar rules
operations (misspelling a word, using a word that doesn’t exist in the
• Output – e.g. printer or monitor language or using “illegal” grammar
• Storage – holds the information for later retrieval Semantic Error – occurs when a correct word is used in
• Syntax – rules governing the word usage and an incorrect context.
punctuation.
• Program Code - instructions you write using a 5. Testing the program – a program that is free of
programming language. syntax errors is not necessarily free of logical
• LOGIC – instruction in a specific sequence. error.
6. Putting the program into production – might
UNDERSTANDING THE PROGRAMMING PROCESS mean simply running the program once, if it was
1. Understanding the problem – the most difficult written to satisfy a user’s request for a special
aspects of programming. A good programmer is list.
often part counsellor, part detective
2. Planning the logic – the heart of the UNDERSTANDING INTERACTIVE USER INPUT
programming process, the programmer plans Prompt – is a message that is displayed on a monitor,
the steps of the program, deciding what steps to asking the user for a response
include and how to order them. Command prompt – is the location on your computer
screen at which you type entries to communicate with
Common Planning Tools the computer’s operating system using text.
• Pseudocode - is an English-like representation of the Graphical User Interface or GUI – allows user to interact
logical steps it takes to solve a problem. with a program in graphical environment.
– Pseudo is a prefix that means “false,” and to Data Hierarchy – data items stored for used on computer
code a program means to put it in a programming systems.
language; therefore, pseudocode simply means “false
1. Character – the smallest unit of data, can be letters,
numbers, and special symbols like “A”, “7”, and “&”.
2. Field – is a single data item, such as lastName,
streetAddress or annualSalary
3. Records – are groups of fields that go together for
some logical reason.
4. Files – are groups of records that go together some
logical reason.
5. Flat file – records that are stored in a file that is not
part of a database.

USING AND NAMING VARIABLES


Variables – are named memory locations, whose
contents can vary or differ overtime.
Naming Variables to be used:
• Variable must be one word – the name can contain
letters, digits, hyphens, underscores or any other
character you choose, with the exception of spaces.
• Variable names should have some appropriate
meaning

UNDERSTANDING THE EVOLUTION OF PROGRAMMING


TECHNIQUES
a. Procedural Programming – focuses on the procedures
that programmers create.
• Focus on the actions that are carried out-for example,
getting input data for an employee and writing the
calculations needed to produce a paycheck from the
data. Procedural programmers would approach the job
of producing a paycheck by breaking down the paycheck-
producing process into manageable subtasks.

b. Object-Oriented Programming – focuses on objects or


“things”, and describes their features, or attributes, and
their behaviors.
SYSTEM DEVELOPMENT LIFE CYCLE
The System Approach
1. Recognize and define a problem or opportunity using
systems thinking.
2. Develop and evaluate alternative system solutions.
3. Select the system solution that best meets your
requirements.
4. Design and selected system solution.
5. Implement and Evaluate the success of the designed
system.

The Systems Development Life Cycle


1. Systems Investigation (Product: Feasibility Study)
– Determine how to address business opportunities and
priorities.
– Conduct a feasibility study to determine whether a
new improved business system is a feasible solution.
– Develop a project management plan and obtain
management approval.

2. Systems Analysis (Product: Functional Requirements)


– Analyze the information needs of employees,
customers and other business stakeholders. – Develop
the functional requirements of a system that can meet
business priorities and the needs of all stakeholders.
– describes what a system should do to meet the
information needs of the users.
– an in-depth study of an end user information needs
that produces functional requirements that for the
design of a new information as the basis are used as the
basis for the design of a new information system. It
involves a detailed study of:
– The information needs of a company and end
users like yourself.
– The activities, resources, and products of one
or more of the present information systems being used.
– The information system capabilities required
to meet your information needs, and those of other
business stakeholders that may use the system.

3. Systems Design (Product: System Specifications)


– Develop specifications for the hardware, software,
people, network, and data resources, and the
information products that will satisfy the functional
requirements of the proposed business information
system
4. Systems Implementation (Product: Operational Tangible benefits – are favourable results, such as
System) decrease in payroll costs caused by a reduction in
– Acquire (or develop) hardware and software. personnel or a decrease in inventory carrying costs
– Test the system, and train people to operate and use it. caused by reduction in inventory.
– Convert to the new business system.
– Manage the effects of system changes on end users. Intangible benefits – are harder to estimate. Such
benefits as better customer service or faster accurate
5. Systems Maintenance (Product: Improved System) information for management fall into this category. 
–Use a post implementation review process to monitor, Examples:
evaluate, and modify the business system as needed  Improved information availability – More timely and
accurate information
Starting the Systems Development Process  Improved customer service – More timely service
1. Feasibility Study response
- Preliminary study where the information needs of  Improved business image – Progressive image as
prospective users and the resource requirement, costs, perceived by customers, suppliers, and investors
benefits, and feasibility of a proposed projects are
determined. A. Organizational Analysis – is an important first step in
- The goal of the feasibility study is to evaluate system analysis. How can anyone improve an
alternative solutions and to propose the most feasible information system if they know very little about the
and desirable business applications for development. organizational environment in which the system is
A. Organizational Feasibility – the focus is on how located? That’s why it is important to know about the
well a proposed system supports the strategic organization, management structure, its people, its
business priorities of the organization. business activities, the environmental systems it must
B. Economic feasibility – is concerned with deal with, its current information systems.
whether expected cost savings, increased
revenue, increased profits, reductions in B. Analysis of the Present System – before designing a
required investment, and other types of new system, it is important to study the system that will
benefits will exceed the costs of developing be improved or replaced. There is a need to analyze how
and operating of a proposed system. this system uses hardware, software, network, and
C. Technical feasibility – can be demonstrated if people resources to convert data resources, such as
reliable hardware and software capable of transactions data, info information products, such as
meeting the needs of a proposed system can reports and displays. Then you should document how the
be acquired or developed by the business in information system activities of input, processing,
the required time. output, storage, and control are accomplished
D. Operational feasibility – is the willingness and
ability of the management, employees, C. Functional Requirements Analysis – this step is one of
customers, suppliers, and others to operate, the most difficult. There’s a need to work as a team with
use and support a proposed system. IS analyst and other end users to determine he specific
business information needs.
Costs /Benefits Analysis
Tangible costs – costs and benefits are quantified. E.g. Functional Requirement
costs of hardware and software, employee, salaries and Examples of Functional Requirements
other quantifiable costs needed to develop and • User Interface Requirements Automatic entry of
implement an IS solution. product data and easy-to-use data entry screens for Web
customers.
Intangible costs – are difficult to quantify; they include • Processing Requirements Fast, automatic calculation of
the loss of customer goodwill or employee morale sales totals and shipping costs.
caused by errors, and disruptions arising from the •Storage Requirements Fast retrieval and update of data
installation of a new system. from product, pricing, and customer databases.
• Control Requirements Signals for data entry errors and
quick e-mail confirmation for customers.

3. Systems Design - specifies how the system will


accomplish the objectives. It consists of design activities
that produce system specifications satisfying the
functional requirements that were developed in the
system analysis process.

User Interface Design – focuses on supporting the


interactions between end users and their computer
based applications.
Systems Specification – formalize the design of an
application’s user interface methods and products,
database structures, and processing and control
procedures.

f. Documentation – Record and communicate detailed


system specifications, including procedures for end users
and IS personnel and examples of input screens and
output displays and reports.
g. Conversion – Convert from the use of a present system
to the operation of a new or improved system.

Parallel Conversion – both old and the new systems are


operating until the project development team and end
user management agree to switch completely over to the
new system.
Pilot Conversion – one department or other work site
serves as a test site
Phased Conversion – only parts of a new application or
only few departments, branch offices, or plant locations
at a time are converted.
Plunge Conversion - direct cutover to a newly developed
system

Вам также может понравиться