Programming and Languages: Telling the Computer What to Do - PowerPoint PPT Presentation

Loading...

PPT – Programming and Languages: Telling the Computer What to Do PowerPoint presentation | free to download - id: 3d6af-ZDg2Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Programming and Languages: Telling the Computer What to Do

Description:

Describe what programmers do ... Programmer designs algorithm and converts it into computer instructions and ... This time error must be found by the programmer. ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 29
Provided by: DebWe3
Learn more at: http://www.mesacc.edu
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Programming and Languages: Telling the Computer What to Do


1
Programming and Languages Telling the
Computer What to Do
  • CIS 105

2
Topics
  • Describe what programmers do
  • Explain how programmers define a problem, plan
    the solution, and then code, test, and document
    the program
  • List and differentiate the control structures
  • List the major programming paradigms
  • Define some concepts of object-oriented
    programming
  • List some major programming languages that are in
    use today

3
Programming
  • Program a set of detailed, step-by-step
    instructions that directs the computer to process
    data into information.
  • Programming is combination of art and science,
    because you may code a program however you like
    as long as you follow the languages rules.
  • Programming language a set of rules (syntax)
    and commands that provides a way of telling the
    computer what operations to perform.
  • Programmer designs algorithm and converts it
    into computer instructions and tests programs as
    developed.

4
Program Development Life Cycle
  • Six main phases
  • Define the problem
  • Design the solution
  • Code the program
  • Test the program
  • Document the program
  • Implement the program
  • The phases will be reviewed over next few slides

5
1. Define the Problem
  • Review program specs
  • Meet with analysts / users
  • Identify program components (IPO Chart Input,
    Processing, Output)

6
2. Design the Solution
  • Design an algorithm.
  • An algorithm is a finite series of logical steps
    required to solve a particular problem.
  • Finite means that the beginning and end are
    clearly defined.
  • Design tools covered in a next few slides
  • Use flowcharts and pseudocode.
  • Use the appropriate programming flow control
    structures in the design
  • Desk check the solution

7
Flowcharting
  • A flowchart is a pictorial representation of an
    algorithm or logical steps.
  • Each step is represented by a symbol and the
    arrows indicate the flow and order of the steps.
  • The shape of the symbol indicates the type of
    operation that is to occur.
  • Flowcharts may help the more visual students
    learn and understand logic.

8
Basic Flowchart Symbols
9
Flow Control Structures
  • Flow control is the order in which statements are
    executed.
  • There are four control structures.
  • Sequence Control
  • Selection Control
  • Also referred to as branching (if and if-else)
  • Case Control (similar to selection)
  • Repetition Control (loops)

10
Sequence Control
11
Selection Control (branching)
12
Case Control
13
Repetition Control (loops)
14
Pseudocode
  • Pseudocode is a mixture of programming code and
    English like statements.
  • Used when designing algorithms.
  • When designing, we dont necessarily want to be
    concerned about specific method names.
  • We want to concentrate on the design and logic.
  • Later we can look up specificproperties or
    method names.

15
Desk Checking
  • After designing a solution, make sure it is going
    to work before coding it by desk checking it.
  • Develop sets of test data (inputs)
  • Determine the expected result (output) for each
    data set without using solution algorithm
  • Step through solution using one set of test data
    writing down actual result obtained (output)
  • Compare expected with actual results
  • Repeat steps 3 4 for each set of test data

16
3. Code the Program
  • Translate solution algorithms into a
    programming language.
  • Enter program code into programming
    development tool using correct syntax.

17
4. Test the Program
  • Remove syntax and logic errors
  • Syntax error - when code violates language rules,
    errors are displayed by the programming
    development tool.
  • Logic error when program does not generate
    expected output when using the test data. This
    time error must be found by the programmer.
  • Logic Errors are also call bugs, so finding and
    fixing logic errors is call debugging.
  • Debug Utility some errors are difficult to
    find, so programmers use a debugger that allows
    them to walk through the code as each statement
    is executed, so that they can verify the flow and
    see the values in variables as they change in
    memory.

18
Quality Assurance (QA)
  • Quality assurance is the activity of providing
    evidence to stakeholders establishing that the
    programs have been completed successfully and are
    ready to be operational.
  • Testing software is the process used to help
    identify the completeness, correctness, security,
    and quality of the developed programs.
  • Growing field Quality Assurance Specialist

19
5. Document the Program
  • Programmer name and date
  • A narrative description of the program
  • Include comments within the source code
  • Flowcharts and/or pseudocode
  • Layouts of input and output records
  • Testing procedures
  • Most of the items would be electronic copies and
    saved in the project library.

20
6. Implement Maintain the Program
  • Programs may be part of a system implementation
    or single program implementation.
  • Training, user manuals, technology upgrades, and
    conversions must be taken into consideration
    during implementation.
  • Eventually programs may need to be updated due to
    mandatory updates such as government regulations
    / requirements, new sales tax rates
  • Programs may be enhanced to add new features or
    functionality
  • Program may become obsolete when changes become
    too difficult or new technology needs to be
    applied.

21
Programming Paradigms
  • Procedural Programming
  • Programmer must provide step-by-step
    instructions, telling the computer what to do and
    how to do it.
  • Logic begins at the top and flows down.
  • Non-procedural language, such as SQL in a
    relational database, the programmer specifies
    what is needed, and the language determines how
    by using the data dictionary.
  • Event Programming
  • A program listens for and reacts to events such
    as mouse click on a button.
  • Object-Oriented Programming (OOP)
  • Use class definitions to build programs.
  • A class definition includes properties
    (attributes) to store information about the class
    and methods (operations) to manipulate the
    properties.
  • A programmer uses a class to declare an object,
    which is then considered an instance of the
    class.
  • Inheritance is when a programmer uses an existing
    class as the base when defining a new class.
    Everything in the base class is included in the
    derived class plus the new properties and
    methods.
  • Visual Basic supports all three paradigms.

22
TextBox Class used in Lab VB
  • The Textbox control is a class definition
    (blueprint) from which objects are created.
  • When the Textbox control is dragged from the
    Toolbox on to a form, an instance (object) of a
    Textbox is created.
  • We can then set the properties, such asName,
    MultiLine, ReadOnly, Text, etc.
  • We can also call methods in the
    coderesultsTextBox.AppendText(addResultString)f
    irstNumberTextBox.Clear( )

23
Popular Programming Languages
  • BASIC (Beginners All-purpose Symbolic
    Instruction Code 1960s)
  • COBOL (Common Business Oriented Language 1960s)
  • C - Used to develop UNIX in 1970s runs on most
    operating system now
  • C - A better C, Object oriented (1980s)
  • Java - Similar to C Became popular because of
    web development applets,Programs run on
    multiple platforms (Win, Unix, Mac), Originally
    named Oak (1991) and renamed to Java in 1995
  • Visual Basic Microsoft created language so that
    graphical user interfaces could be created for
    their new operating system Windows (1990s)
  • C (c-sharp) Microsofts newest language
    (2002) syntax is similar to Java, but uses the
    VB library.
  • See next slide for examples

24
Examples of Programming Languages
C
VisualBasic
Java
25
Compilers Interpreters
An interpreter translates one line of the source
code at a time. Interpreters run programs more
slowly than compilers, but they are helpful
programs for finding syntax errors, because they
are interactive.
26
Web Page Program Development
  • HTML
  • Pages are defined using tags ( lthtmlgt lt/htmlgt )
  • Cascading Style Sheets (CSS) contains formats
  • Client-side Scripts
  • Interpreted programs that run on the client
  • JavaScript, Perl, Php used to generate Dynamic
    HTML (DHTML)
  • Applet compiled Java that runs on the client
    it is faster than a script
  • Server-side Scripts (programming)
  • Interpreted or compiled programs that run on the
    server
  • CGI (common gateway interface, Perl, Php, ASP,
    JSP)
  • Servlet a Java (JSP) applet that runs on the
    server
  • Multimedia Authoring Software
  • Flash, Quicktime, Authorware, Director, etc.

27
Selecting a Language or Tool
  • Standards of the organization may specify which
    programming language is used.
  • New programs may need to interface with other
    existing or future programs.
  • Suitability of the language to the application.
  • Portability to other systems and platforms.

28
MCC Related Courses
  • CIS150AB Intro Object-Oriented Programming
  • CIS159 Visual Basic
  • CIS162AB C
  • CIS162AD C
  • CIS163AA Java
  • CIS133CA Intro to Web Development (1 credit)
  • CIS166AA JavaScript
  • CIS166AC ASP Web Scripting
  • CIS166AE PHP Web Scripting
About PowerShow.com