0% found this document useful (0 votes)
15 views

INFO 101 Chapter 13 - Programming and Languages

Uploaded by

andykinggmama
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

INFO 101 Chapter 13 - Programming and Languages

Uploaded by

andykinggmama
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Chapter 13

Programming and Languages

INFO 101: Communication, Information and Society


Chapter 13

Programming and Languages


Learning Objectives
1. Define programming and describe the six steps of
programming.
2. Compare design tools including top-down design,
pseudocode, flowcharts, and logic structures.
3. Describe program testing and the tools for finding and
removing errors.
4. Describe CASE tools and object-oriented software
development.
5. Explain the five generations of programming languages.

3
Introduction
• In this chapter, you focus on
Phase 4, Systems
Development, of the systems
life cycle and learn about the
programming process and
some of the programming
languages that are available.
• Competent end users need
to understand the
relationship between
systems development and
programming.

4
Programs and Programming
• Program
• A list of instructions for the computer to follow to accomplish the task of
processing data into information.
• Statements used in a programming language such as C++, Java, or
Python.
• Programs can be:
• Prewritten/packaged.
• Custom-made.

• Programming or Software Development


• A problem-solving procedure.
• List of instructions for the computer to follow to process data.
• Follows a six-step process know as the System Development Life
Cycle.

5
Six-Step Software Development Life Cycle
• The six steps are as
follows:
1. Program specification.
2. Program design.
3. Program code.
4. Program test.
5. Program
documentation.
6. Program maintenance.

• Access the text alternative for slide images.


6
Program Specification
• Also called program
definition or program
analysis
• Five items must be
specified:
1. Program’s objectives.
2. Desired output.
3. Input data required.
4. Processing
requirements.
5. Documentation.

• Access the text alternative for slide images.


7
Defining Program Specification
• Program objectives
• Requires a clear statement of the problem being addressed.

• Desired output
• The end-user should communicate the inputs and outputs.

• Input data
• Determine the source of the data.

• Processing requirements
• Tasks to move input to
output.
• Program specification document
• Document program
specifications.
• Access the text alternative for slide images.
8
Program Design
• Plan a solution using
structured programming
techniques
• Techniques:
• Top-down design.
• Pseudocode.
• Flowcharts.
• Logic structures.

9
Top-Down Program Design
• To identify the program’s
processing steps; called
modules
• Each module is made up of
logically related program
statements.

• Access the text alternative for slide images.


10
Pseudocode
• An outline of the logic of the program you will write.
• Summary of the program before it is written

• Access the text alternative for slide images.


11
Flowcharts
• Graphically present
the detailed
sequence of steps
needed to solve a
programming
problem

• Access the text alternative for slide images.


12
Logic Structures
• Enables you to write structured • Sequence • Repetition
programs, which take much of the
guesswork out of programming
• Sequential structure.
• One program statement
follows another.

• Selection structure.
• A decision must be made. • Selection

• Repetition structure or Loop


Structure.
• Describes a process that may
be repeated as long as certain
condition remains true.

• Access the text alternative for slide images.


13
Program Code
• Writing the program is called
coding
• Characteristics of a good
program:
• Reliable.
• Produces the correct output.
• Catches common input
errors.
• Well-documented and
understandable.
• Structured programs – one of
the best ways to code
effective programs.
• Using logic structure.

14
Coding
• Write the program
• A programming language
uses a collection of symbols,
words, and phrases that
instruct a computer to
perform specific operations.

15
Programming Languages
Language Description
C++ Extends C to use objects or program modules that can be reused and interchanged between
programs.
C# A programming language designed by Microsoft to extend C++ for developing applications in the
Windows environment.
Java Primarily used for Internet applications; similar to C++; runs with a variety of operating systems.

JavaScript Embedded into web pages to provide dynamic and interactive content.

Python General-purpose programming language that is simple and easy to learn. Frequently used in
introductory programming courses.
Swift Uses graphical user interface and special code for touch screen interfaces to create apps for Apple
iOS devices.

16
Program Test
• Debugging
• The process of testing and then
eliminating errors such as:
• Syntax errors are a violation
of the rules of programming
language.
• Logic errors occur when the
programmer uses incorrect
calculation or leaves out a
programming procedure.
• Testing process involves one
or more of several methods.

• Access the text alternative for slide images.


17
Program Testing Processes
• Desk checking or Code review
• Printout of program reviewed line by line.

• Manual testing with sample data


• Correct and incorrect data manually entered, results evaluated.

• Attempt at translation
• Written program goes through translator program on the computer,
must be syntax error free.

• Testing sample data on the computer


• Tests for logic errors.

• Beta testing
• Testing by a select group of potential users; users provide feedback.

18
Program Documentation
• Written descriptions and procedures
about a program and how to use it
• Carried on throughout the
programing steps.

• Important for people who will use


and/or support the program
• Users need to know how to use the
software.
• Operators need to know what to do
about any error messages.
• Programmers may even remember
all the details.
• Those taking over the program
will need to know details.

19
Program Maintenance
• 75% of total lifetime cost for an
application is for maintenance.
• Ensures program is:
• Error-free.
• Effective.
• Efficient.

• Two activity categories.


1. Operations.
• Patches – programming
modification or corrections.
• Software updates – significant
patches.

2. Changing needs.
• Agile development – starts with getting the core functionality working then expands
through to customer satisfaction.

• Figure 13-20
20
Case Tools and Object-Oriented
Programming
• Computer-aided software engineering (CASE)
• Automates portions of the development process.

• Object-oriented software – OOP


• Focuses less on procedures, more on relationships with previously defined
procedure.
• Objects contain both the data and the processing operations needed to
perform a task.

21
Generations of Programming Languages
• Levels or Generations
• Coding from machine languages to human or natural languages.

• There are five distinct generations


• Lower level is closer to machine language.
• Higher level is closer to human-like language.

22
Five Generations
• 1st Gen: Machine languages
• Data represented in 1s and 0s.

• 2nd Gen: Assembly languages


• Uses abbreviations or mnemonics that are automatically converted to the appropriate
sequence of 1s and 0s.

• 3rd Gen: High level procedural languages (3GLs)


• Designed to express the logic – the procedures – that can solve general problems.
Translated into machine language with a compiler or an interpreter.

• 4th Gen: Task-oriented languages (4GLs)


• Designed to solve specific problems.

• 5th Gen: Problem and Constraint languages (5GL)


• Computer languages that incorporate the concepts of artificial intelligence to allow a
person to provide a system with a problem and some constraints and then request a
solution.

23
Generation Samples
• Listed below are samples of each generation programming
language in order from the 1st through the 5th

Generation Sample Statement


First: Machine 111100100111001111010010000100000111000000101011
Second: Assembly ADD 210(8,13),02B(4,7)
Third: Procedural if (score > = 90) grade =‘A’;
Fourth: Task SELECT client FROM daily Log WHERE serviceEnd >17
Fifth: Problems and Get patientDiagnosis from patientSymptoms "sneezing", “coughing” “aching”
Constraints

24
Careers in IT
• Computer programmers
create, test, troubleshoot,
update and repair programs
• Employers seek individuals
with
• Degree in Computer Science or
Information Systems.
• Desired traits include patience,
logical thinking, and attention to
detail.

• Computer Programmers can expect to earn $65,760 to


$112,120 annually

25
A Look to the Future
• Your Own Programmable
Robot
• To stay competitive with today’s
fast business pace, new
technologies must be
incorporated.
• Increased use of RAD and
prototyping.
• Increased use of outside
consulting.

26
Open Ended Questions
1. Identify and discuss each of the six steps of programming.
2. Describe CASE tools and OOP. How does CASE assist
programmers?
3. What is meant by “generation” in reference to
programming languages? What is the difference between
low-level and high-level languages?
4. What is the difference between a compiler and an
interpreter?
5. What are logic structures? Describe the differences
between the three types.

27
Six-Step Software Development Life Cycle
– Text Alternative
• Return to parent-slide containing images.

• The steps are:


Program specification
Program design
Program code
Program test
Program documentation
Program maintenance

• Return to parent-slide containing images. 29


Program Specification – Text Alternative
• Return to parent-slide containing images.

• The needed steps are:


objectives
output
Inputs
Processing requirements
Documentation
leading to design.

• Return to parent-slide containing images. 30


Defining Program Specification – Text
Alternative
• Return to parent-slide containing images.
1

• This example is for a client named Allen Realty for the


month of January in the year 2016. The table is made up of
five columns: date, worker, regular hours and rate, overtime
hours and rate, and bill.

• Advance to rest of text alternative. 31


Defining Program Specification – Text
Alternative 2
• Return to parent-slide containing images.

• This example of a daily log shows information for four


clients (labeled A, B, C, and D). Three columns of
information are included in the table: job, time in, and time
out.

• Return to parent-slide containing images. 32


Top-Down Program Design – Text
Alternative
• Return to parent-slide containing images.

• Top level shows Time-and-billing process which breaks


down into two nodes: obtain input and produce output.
Obtain input breaks down into two nodes: obtain daily logs
and computer hours for billing.
Product output breaks down into two nodes: print client bills,
and print time-and-billing report.
Computer hours for billing breaks down into a series of
nodes shown as: compute time on client A jobs, compute
time on client Z jobs.
Print client bills breaks down into a series of nodes shown
as: client A bills, Client Z bills.

• Return to parent-slide containing images. 33


Pseudocode – Text Alternative
• Return to parent-slide containing images.

• "Example reads:Computer time for Client A.Set total regular


hours and total overtime hours to zero.Get time in and time
out for a job.If worked past 1700 hours, then compute
overtime hours.Compute regular hours.Add regular hours to
total regular hours.Add overtime hours to total overtime
hours.If there are more jobs for that client, go back and
compute for that job as well."

• Return to parent-slide containing images. 34


Flowcharts – Text Alternative
• Return to parent-slide containing images.

• "A terminal symbol is labeled Start and triggers a process labeled


""set total regular hours equal zero and total overtime hours
equal zero.""This process leads to an input/output step labeled
""get job record for client"" which feeds a decision point ""work
past 1700?""If yes, enter a process labeled ""compute overtime
hours"" before entering a connector. If no, go straight to the
connector.The connector leads to a process labeled ""compute
regular hours"", which leads to a process labeled ""add regular
hours to total regular hours"", and finally to a process labeled
""add overtime hours to total overtime hours.""This final process
feeds a decision point ""more jobs for client?"".If yes, loop back
to the input/output step labeled ""get job record for client."" If no,
enter a terminal symbol labeled stop."

• Return to parent-slide containing images. 35


Logic Structures – Text Alternative 1

• Return to parent-slide containing images.

• "A connector leads to a decision point labeled ""DO WHILE,


test condition.""If yes, enter a process labeled ""Loop,
statement"" and from there go back to connector.If no, enter
next ""DO WHILE"" process."

• Advance to rest of text alternative. 36


Logic Structures – Text Alternative 2

• Return to parent-slide containing images.

• "A decision point is labeled ""IF, test condition.""If yes, enter


a process labeled ""THEN, statement"" and then a
connector.If no, enter a process labeled ""ELSE,
statement"" and then the same connector."

• Return to parent-slide containing images. 37


Program Test – Text Alternative
• Return to parent-slide containing images.

• Testing begins with a desk check which leads to manual


test, then translate, then sample data, and finally beta test
activities that provide input to the document step.

• Return to parent-slide containing images. 38


Q&A Session
40

You might also like