26-mar-2015 · markup languages "markup languages use symbols or tags to describe what a...

5
26-Mar-2015 1 CC111 Lec#5: Program Development Program Development and Programming Languages C# CC111 Lec#5: Program Development The Program Development Life Cycle Creating new programs is called program development. The process associated with creating successful applications programs is called the program development life cycle (PDLC). CC111 Lec#5: Program Development The Program Development Life Cycle CC111 Lec#5: Program Development How Code Relates to the .NET Framework CC111 Lec#5: Program Development How Code Relates to the .NET Framework CC111 Lec#5: Program Development How Code Relates to the .NET Framework CC111 Lec#5: Program Development Problem Analysis • During problem analysis, a systems analyst and programmer review specifications and talk with users to fully understand what the software should do. • Documentation consists of program specifications, timetable, which language will be used, how the program will be tested, and what documentation is required. CC111 Lec#5: Program Development Program Design Program design: stage where program specifications are expanded into a complete design of the new program. Structured programming and object-oriented programming are two of the most significant approaches to the design process. CC111 Lec#5: Program Development Program Design: Program Design Tools Program design tools are planning tools. Structure charts Program flowcharts Pseudocode Data modeling

Upload: others

Post on 04-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 26-Mar-2015 · Markup Languages "Markup languages use symbols or tags to describe what a document should look like when displayed. HTML (Hypertext Markup Language) Dynamic HTML XML

26-Mar-2015

1

CC111 Lec#5: Program Development

Program Development andProgramming Languages

C#

CC111 Lec#5: Program Development

The Program Development Life Cycle

Creating new programs is called programdevelopment.

The process associated with creatingsuccessful applications programs is called theprogram development life cycle (PDLC).

CC111 Lec#5: Program Development

The Program Development Life Cycle

CC111 Lec#5: Program Development

How Code Relates to the .NET Framework

CC111 Lec#5: Program Development

How Code Relates to the .NET Framework

CC111 Lec#5: Program Development

How Code Relates to the .NET Framework

CC111 Lec#5: Program Development

Problem Analysis

• During problem analysis, a systems analyst andprogrammer review specifications and talk withusers to fully understand what the softwareshould do.

• Documentation consists of programspecifications, timetable, which language will beused, how the program will be tested, and whatdocumentation is required.

CC111 Lec#5: Program Development

Program Design

• Program design: stage where program specificationsare expanded into a complete design of the newprogram.

• Structured programming and object-orientedprogramming are two of the most significantapproaches to the design process.

CC111 Lec#5: Program Development

Program Design:Program Design Tools

Program design tools are planning tools.• Structure charts

• Program flowcharts

• Pseudocode

• Data modeling

Page 2: 26-Mar-2015 · Markup Languages "Markup languages use symbols or tags to describe what a document should look like when displayed. HTML (Hypertext Markup Language) Dynamic HTML XML

26-Mar-2015

2

CC111 Lec#5: Program Development

Program Design:Program Design Tools

Structure chartsdepict the overall organization of a program, and how themodules of a program—logically related operations thatperform a well-defined task—are defined and how theyconnect to each other hierarchically.

Program modules should be arranged hierarchically, in a top-down fashion, so that their relationship to each other isapparent.

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Program flowcharts use geometric symbols and familiar relational operators to

provide a graphic display of the sequence of steps involved ina program.

The steps in a flowchart follow each other in the same logicalsequence as their corresponding program statements willfollow in a program.

Different symbols are used to represent different actions, suchas start/stop, decision, input/output, processing, and loopingsymbols.

Program Design:Program Design Tools

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Pseudocodeuses English-like statements in place of the graphic symbols ofthe flowchart.

Unlike a flowchart, pseudocode is easy to modify and can beembedded into a program as comments.

No standard set of rules exists for writing pseudocode, although anumber of conventions have been developed.

Program Design:Program Design Tools

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Data modeling:a technique used to illustrate the data in an application and is

frequently used with object-oriented programming.

In a data model, the objects in the program are identified, alongwith their variables and class.

Program Design:Program Design Tools

Page 3: 26-Mar-2015 · Markup Languages "Markup languages use symbols or tags to describe what a document should look like when displayed. HTML (Hypertext Markup Language) Dynamic HTML XML

26-Mar-2015

3

CC111 Lec#5: Program Development

Program Design:Control Structures

• Sequence

• Selection

• Iteration

CC111 Lec#5: Program Development

Program Design: Control Structures

Sequence

A sequence control structure is simply a series ofprocedures that follow one another.

Statement Statement Statement . . .

CC111 Lec#5: Program Development

Program Design: Control Structures

Selection The selection (if-then-else) control structure involves a choice: ifa certain condition is true, then follow one procedure; else, iffalse, follow another.

When more than two possible choices exist, the case controlstructure can be used instead.

Statement1

StatementStatement2

Condition . . .

CC111 Lec#5: Program Development

Program Design: Control Structures

Iteration loop is an operation that repeats until a certain condition is met. A looping (iteration) control structure can take two forms. With the do-while structure, the loop is executed as long as acondition is true; with the do-until structure, the loop continues until acertain condition becomes true.

Statement

Condition . . .False

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Program Design:Good Program Design

Good program design is essential; it can save time and itproduces a better end result. Some principles of goodprogram design are:

• Be specific

• One-entry-point, one-exit-point rule

• No infinite loops

• Documentation during program design includes all thedesign specifications

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Program Coding

• Coding: actual process of creating the program in aprogramming language.– Programming language must be chosen.– Coding standards should be adhered to.– Make use of reusable code and data dictionaries.– Translate coded programs into executable code.

• Documentation results in finished source code.

CC111 Lec#5: Program Development

Page 4: 26-Mar-2015 · Markup Languages "Markup languages use symbols or tags to describe what a document should look like when displayed. HTML (Hypertext Markup Language) Dynamic HTML XML

26-Mar-2015

4

CC111 Lec#5: Program Development

Program Coding

The coded program is referred to as source code.to be executed, the program is converted by thecomputer to object code using a special program.

A compiler translates the entire program into machinelanguage before executing it. The program then doesn’tneed to be recompiled until it is modified.

An interpreter translates program statements one at atime. Interpreters are helpful during the debuggingstage, but are slower during execution of the finishedprogram.

An assembler converts assembly-language statementsinto machine language.

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Program Debugging and Testing

• Debugging: process of making sure a program is free oferrors or bugs.– Preliminary bugging often finds syntax or logic

errors.– Testing can consist of alpha or beta testing.

• Documentation includes a copy of the finished programcode, plus test data and results.

CC111 Lec#5: Program Development

Program Debugging and Testing

Preliminary debugging begins after the program has beenentered into the computer system. Rarely is a program error-free the first time it runs. Two common types of errors aresyntax errors and logic errors.

A syntax error occurs when the programmer has notfollowed the rules of the language.

A logic error, or execution-time error, results when thecommand syntax is correct but the program is producingincorrect results.

CC111 Lec#5: Program Development

Program Debugging and Testing

At some point in the preliminary debugging process, theprogram will appear to be correct. At this point, theprogrammer, or preferably someone else, will run the originalprogram with extensive test data.

Good test data will subject the program to all the conditionsit might conceivably encounter when finally implemented.

Most companies run on-site alpha tests to test programs;companies in the business of selling software also commonlyrun beta tests by distributing preliminary versions of theprogram to outside users.

CC111 Lec#5: Program Development

Program Maintenance

• Program maintenance: process of updating software sothat it continues to be useful.– A costly process, but can be used to extend the life of

a program.

• Documentation consists of amended program packagereflecting what problems occurred and what programchanges were made.

CC111 Lec#5: Program Development

What Is a Programming Language?

A programming language is a set ofrules used to write instructions to the

computer.

CC111 Lec#5: Program Development

Categories of Programming Languages

• Low-level languages

• High-level languages

• Fourth-generation languages (4GLs)

• Natural and visual languages

CC111 Lec#5: Program Development

Categories of Programming Languages

Machine and assembly languages are called low-levellanguages, because programmers who code in them mustwrite instructions at the finest level of detail, the base level ofthe hardware.

Although virtually no one writes machine-language programsanymore, all programs must be translated by a languagetranslator into machine language before they are executed.

Assembly languages are fast and consume little storagewhen compared with higher-level languages, but take longerto write and maintain.

Page 5: 26-Mar-2015 · Markup Languages "Markup languages use symbols or tags to describe what a document should look like when displayed. HTML (Hypertext Markup Language) Dynamic HTML XML

26-Mar-2015

5

CC111 Lec#5: Program Development

Categories of Programming Languages

High-level languages differ from their low-levelpredecessors in that they require less coding detail and makeprograms easier to write.

Programs written in a high-level language (BASIC, COBOL,Pascal, C, etc.) need to be translated into machine languagebefore they can be executed.

CC111 Lec#5: Program Development

Categories of Programming Languages

Very-high-level languages, also known as fourth-generation languages (4GLs), are much easier to usethan the high-level languages that preceded them, becausethey are declarative rather than procedural languages.

For instance, to draw a bar chart in a procedural language,you must tell the computer how to draw bars and where toplace them. In a declarative language, you may be able to justpoint to the data you want graphed, click several menu choices,and you’re in business. Fourth-generation languages arecommonly used to access databases (query languages).

CC111 Lec#5: Program Development

Popular Programming Languages

• FORTRAN

• COBOL

• Pascal

BASIC and Visual Basic

C, C++, AND C#

Java

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Markup Languages

• Markup languages use symbols or tags to describewhat a document should look like when displayed.

– HTML (Hypertext Markup Language)– Dynamic HTML– XML (extensible markup language)– XHTML (extensible Hypertext Markup Language)– WML (Wireless Markup Language )

CC111 Lec#5: Program Development

CC111 Lec#5: Program Development

Scripting Languages

• Scripting languages are used to build programinstructions into Web pages, usually to add dynamiccontent.

– JavaScript

– VBScript

– Perl

CC111 Lec#5: Program Development