Unit 4. Application Software 4.1 Software Basics 4.2 Using Software Systems 4.3 Batch Script Files 4.4 Databases 4.5 Software Engineering. - презентация
Презентация была опубликована
Презентация на тему: " Unit 4. Application Software 4.1 Software Basics 4.2 Using Software Systems 4.3 Batch Script Files 4.4 Databases 4.5 Software Engineering." — Транскрипт:
Unit 4. Application Software 4.1 Software Basics 4.2 Using Software Systems 4.3 Batch Script Files 4.4 Databases 4.5 Software Engineering
4.1 Software Basics Software Basics Software Installation and Copyrights
4.1.1 Software Basics A computer program is a set of detailed, step- by-step instructions that tells a computer how to solve a problem or carry out a task. –The steps in a computer program are written in a language that the computer can interpret and process. Programs handle –simple task and –complex task. Programs are written in a language which the computer can interpret and process.
What kinds of files are included in a typical software product ? A computer program is a set of instructions that tells a computer how to solve a problem or carry out a task Software includes Executable files Support modules Data files
Software Basics Software comprises of the following: –set of one or more programs to be used directly or indirectly in a computer to perform a certain task. –associated data for the instructions. An example of computer software
Who creates computer software? Computer programmers write the instructions for the computer programs Software publishers distribute the software –They specialize in packaging, marketing, and selling commercial software
Computer Programming Languages A computer programming language allows a programmer to write a program using English-like instructions. BASIC, Visual Basic, C, C++, COBOL, and JAVA
How does a programmer write software? Most software is designed to provide a task-related environment desktop, smartphone Most software is designed to provide a task-related environment desktop, smartphone Programmer defines the properties for each element in the environment (demo in VS 2008) –Height –Label –What happens when you click it A computer language provides the tools that a programmer uses to create software –High-level languages –Source code
How are instructions converted to machine language? A compiler translates all of the high-level instructions in a program as a single batch (of 1s and 0s) The resulting machine language instructions are called the object code The resulting machine language instructions are called the object code
How are instructions converted to machine language? An alternative to a compiler is an interpreter, that converts one instruction at a time while a program is running –Java Year 2009
4.1.2 Software Installation and Copyrights Software Installation Software Copyrights
Installation Basics: What s included in a typical software package? The key ingredients necessary to install new software are –the files that contain the programs and data Usually supplied on distribution media –floppy disks –CD-ROMS –DVDs
How do I know if a software program will work on my computer? System requirements specify the operating system and minimum hardware requirements necessary for a software product to work correctly System requirements are listed on the outside of the software package.
Why is it necessary to install most software? When you install software, the new software files are placed in the appropriate folders on your computers hard disk –Copies files from distribution disk –Uncompresses files –Analyzes computers resources –Analyzes hardware components and peripheral devices –Looks for any system files and players –Updates necessary system files
Installing from a Distribution Media: How do I install software from distribution media? A setup program guides you through the installation process Following the program will make installation easy
Installing Downloaded Software: Is the installation process different for downloaded software? Sometimes files are zipped, so they must be unzipped Other types –Self-installing executable file –Self-executing zip file –Non-executing Zip file
Is installing a software update different from installing a the original version? Similar to installing a full version Update provides a setup file that checks to make sure that your computer contains a valid version of software to upgrade Software patches Service packs
Uninstalling Software: How do I get rid of software? Uninstall routine( ) deletes the softwares files Or ? –Windows Operating systems use a consistent setup program for installing.
Software Compatibility ( ) Software should be compatible with the operating system in your computer. Same Software is available for different type of computer. –Ms word is available for both PC and MAC but different version. Operating systems are downwardly compatible ( ) which means –that application software of earlier version can be used but not of later version.
Software Compatibility ( ) To be compatible, software must be: –written for the type of computer you use –written for your computers operating system System requirements specify operating system and minimum hardware capacity –listed outside software package
Determine Compatibility Make sure software is written for PC or Macintosh. Make sure software will work with your operating system. –higher number = more recent version –version v.s. revision JDK 6 U17 Operating systems are downward compatible ( ), meaning you can use software designed for earlier versions of the software, but not later.
Copyrighted Software Software is protected by copyright ( ) A copyright is a form of legal protection that grants the copyright owner exclusive rights –To copy the software, –To distribute and sell it, and –To modify it. –To modify it. Purchase of software give the right to use the software but not to copy or distribute it.
Copyrighted Software Software pirates ( ) are people who illegally copy distribute software or modify software – Pirated Software( ): illegal copies of software. Software without copyright notice ( ) is also protected by Copyright Laws. Copyright Laws allow software to be copied or modified under certain circumstances.
Different Types of Licenses Software License ( ): Legal contract which defines what ways the software has to be used. Microcomputer Software has license on the outside package, on a separate card inside package or on CD packaging. Mainframe computer licenses are separate legal document, negotiated between the software publisher and a corporate buyer. Copyright Law extends the right to copy it on both home computer and office computer.
Different Types of Licenses Shrink-Wrap Licenses: –Floppies, CD-ROM and DVD in the package are usually sealed in an envelope or plastic shrink wrapping –the opening the wraps indicates that your agreement to the license. Single User License: Most commercial Software limits the license to one user at a time.
Licenses for More than One User Multiple-user License: –allows more than one person to use a software. –Beneficial when more users wants to have a personalized version of the software. –For example: Electronic mail program where multiple users require their own mailbox
Licenses for More than One User Concurrent License( ): –License offered for one or more copies of the software concurrently priced at increments for each copy. –For example: License for 5 copies cost $2,500 and 10 copies cost $10,000 Site License : License for software using at certain site like corporate office or university campus.
Shareware Licenses Shareware : –software used freely for a trial period and –pay a registration fee after the trial period. Licenses offered for shareware: –Allowed to make copies and distribute the copies –Not permitted to modify the software. –Provides low cost marketing and distribution channel.
Shareware Licenses Freeware Freeware Open source software Open source software
Public Domain Software Author of the software abandons all the right to the software. Places it in public domain making them available to the public. Owned by the public rather than by the author. Freely copied, distributed and even resold. Primary restriction is to apply for the copyright for the software.
Application Software helps the human computerize ( ) a specific task. Computerizes the task which can be done without a computer. –word processing software used to prepare documents and reports which can be done without a computer.
Different Types of Software Document Production Software Graphics Software Presentation software Spreadsheet and statistical software Data management Software Information and Reference Software Connectivity Software Education and Training Software Entertainment Software Accounting and Finance Software Business Software
4.2 Using Software Systems Lab: DOS Commands Lab: Macros Lab: Embedding Application Objects Practice yourselves
Macros A macro is a recorded sequence of keyboard and/or mouse clicks within an application –The application must support macros –It can simplify a complicated set of instructions, so that other people can perform the operation without having to understand all of the details involved with the application interface –a user can define a shortcut for a set of actions that are used frequently.
Object Linking and Embedding Object Linking and Embedding (OLE ) allows data, typically graphics or spreadsheets, that has been created by a different application to be combined into one document Embedding data into a document is much more powerful than the simple copy and paste Linking allows the embedded data to be updated when the original data is changed.
In OS In OS often required when interacting with the operating system's user interface ("command interpreter" or "shell"). set up a daily routine that copies all word processing files to a removable disk and deletes all the files in the "Temp" folder on the hard drive. perhaps you want these actions to be performed in the middle of the night when there is nobody around to initiate them.
4.3.1 Advanced Command-Line Functions DOS Command Syntax Review of File System Commands Wildcard Characters Redirection and Piping
DOS Commands DOS Command Syntax ( ) –Syntax – the rules of DOS –Commands can have one or more switched Written as a slash / dir /w Switches can have parameters( ) using a colon : dir /o:s –Commands can take arguments such as file names or paths dir /w c:
DOS Commands (continued) cd Change working directory md Make new directory rd Remove an existing empty directory deltree Remove an existing directory & contents attrib Change a files attributes, read, system copy Make a copy of a file xcopy Make a copy of files & subdirectories
DOS Commands (continued) ren Rename a file within a directory move Move a file from one directory/drive del Delete files dir List files in a directory type Display contents of a text file
DOS Commands Wildcard is an asterisk (*) that can match any number of characters in a file dir c:\n* dir c:\*n dir c:\*n* dir c:\*.doc dir c:\*
Redirection and Piping Redirection ( ) allows for the overriding of the standard I/O processes – < is used to redirect standard input example: c:\program.exe is used to redirect standard output example: dir c:\*.*>c:\temp.txt Piping( ) is a function of the command processor that links two commands together via redirection –The output of the first command becomes the input of the second command example: set | findstr /i home
batch file batch file The term batch file originally meant non-interactive. In early computer systems –users would submit programs on decks of punched cards, which would be collected into batches and run. –The output was then printed and returned to the users. As operating systems developed further –batch processing came to include a scheduling ( ) function, whereby the system would choose which job to run next based on priority level and resources required. –It was also possible to specify that a job should run at a particular time of day (do disk backups at night) or repeatedly (a weekly inventory report or monthly payroll processing at a company)
batch file batch programs were –self-contained and –did not rely on user interaction.
batch file A batch file under Windows, or a "shell script" in UNIX, performs a similar function. –consists of a sequence of commands to run programs and manipulate files. It is possible to construct completely autonomous batch files that require no user interaction to run –but this is not strictly necessary. –but this is not strictly necessary. –The DOS batch files provide for some simple forms of user interaction.
A batch file under Windows is a plain text file with the extension.BAT. A batch file contains –DOS commands and –names of programs to execute. The file may also contain flow control commands that tell the command processor –to loop (repeat certain instructions) or –to handle error conditions in a particular way.
common use of batch files is to write new commands. is to write new commands. batch file SWAP.BAT that swaps two files by renaming them REM Here is the source to SWAP file1 OFF REM Remember that / precedes a switch. REM Use HELP DEL or DEL /? to find out about /Q DEL/Q TEMP MOVE %1 TEMP MOVE %2 %1 MOVE TEMP %2 notation –%1, %2, etc., refers to the arguments to the swap command. –SWAP A.TXT B.DOC while the batch file is executing the %1 is equivalent to A.TXT, and the %2 is equivalent to B.DOC. –It is also possible to introduce named variables in a batch file, such as %NAME%, by using assignment statements.
Creating a batch file is actually a type of programming using a "language" that is very limited. One unusual feature of this language is that a syntax error in one line –does not stop the execution of the file. If error, an error message is displayed and the batch file continues with the next command. This could have unintended consequences( ). Just as with other types of programs, it is important to test a batch file thoroughly before using it in any critical application. Just as with other types of programs, it is important to test a batch file thoroughly before using it in any critical application.
Batch Files Allow you to record the actions you perform with a mouse for later playback using the OSs command line interface Batch files in UNIX OS is called script files. a batch OFF REM Student Name if EXIST %1 goto ERRORMSG dir %2 c:\ > %1 goto END :ERRORMSG ECHO The %1 already exists, aborting EXDIR :END
Commands The following is a list of command-line features commonly used in batch files: rem remark –This designates anything that follows the rem command on the line (remark in our example) as a comment. echo message –This command displays message to Standard Output. –The echo command can also be used with output redirection to send a message to a file. –For example, echo starting stage three.
Commands echo. –Notice the period (. ) at the end of the echo command. –This is a special variation of the echo command, which displays a blank line to Standard Output. –This is a special variation of the echo command, which displays a blank line to Standard off –This stops commands in the batch file from being displayed to Standard Output. –By default, each line of text in the batch file encountered by the command processor is displayed to Standard Output. –While this default mode is useful for debugging purposes, the resulting display often confuses users, so most commands written as batch files begin echo off.
Commands Pause –This command interrupts the execution of the batch file and displays the message "Press any key to continue...." –resumes when a single keyboard key is pressed. –This command is useful if you want to make a batch file stop(how to?) and wait for the user to perform some action (such as inserting a floppy disk) before it continues executing. : label –Any line starts with a colon ( : ) is considered a label. –Labels are used by certain flow control commands to repeat or skip over certain lines in the file. –After the colon ( : ), some appropriate name as the label name. name should not contain any spaces. name should not contain any spaces.
Commands goto label –This command causes the command processor to execute the first command line after the label referenced by the command. if exist filename command –This command evaluates the current working directory for a file or subdirectory. –if the statement is true (that is, if a file named filename exists), then the command is executed.
4.3.3 Lab: Creating a Batch File Example of a Batch File Example of a Batch File with Arguments
Example of a Batch File REM Batch file created by John ECHO OFF ECHO Copying Word and PowerPoint files to a floppy :LOOP ECHO Please insert a floppy into drive A: PAUSE COPY C:\data\smith\*.doc a:\ COPY C:\data\smith\*.ppt a:\ GOTO LOOP
Example of a Batch File with Arguments REM Batch file created by John ECHO OFF ECHO Copying Word and PPT files :LOOP ECHO Please insert floppy into drive A: PAUSE COPY C:\data\%1\*.doc a:\* COPY C:\data\%1\*.ppt a:\* GOTO LOOP
Batch files may take more than one argument The first argument is %1, the second %2, the third %3, and so on …… REM Batch file created by John ECHO OFF ECHO Copying files :LOOP ECHO Please insert floppy into drive A: PAUSE COPY C:\data\%1\*.%2 a:\* GOTO LOOP
Databases Databases Specialized databases are available for particular applications. Data files are files where data is organized in an uniform format. Data files are files where data is organized in an uniform format. Data management is referred as –maintaining and –maintaining and –access data in a data file. –access data in a data file.
Databases Fields : Smallest unit of meaningful data and forms the basic building block of data file. Data types : the way the data is represented. Entity : it is a person, place, thing or event about which data is stored. Records : Collection of fields of data about on entity.
File and Database Concepts The term data file has multiple definitions. You can use clues from the context of the sentence it is used in to decide what it means. The term data file has multiple definitions. You can use clues from the context of the sentence it is used in to decide what it means. Data management refers to the tasks associated with maintaining and accessing the data stored in a data file. Each data file has a file structure that describes the way in which the data is stored in that file. Each data file has a file structure that describes the way in which the data is stored in that file. A file contains records that are made up of fields
Fields A field –contains the smallest unit of meaningful data and –be thought of as the basic building block for a data file. Each field has a field name that describes its contents. A variable-length field expands to fit the data you enter. A fixed-length field contains a predetermined number of bytes.
Data Types Determines the way a data is represented and manipulated. Determines the way a data is represented and manipulated. Common data types are numeric and character. Numeric data type: –assigned to fields that contains numbers for mathematical calculation, averaging etc. Real Numbers: contains fractional numbers that is number with decimal points. Integers: contains whole numbers
Data Types Character (string) data type: –assigned to fields that is not used in mathematical calculations. Date data type: –assigned to fields for manipulating dates. Logical data type: –accepts two values such as yes/no or true/false. Memo data type: –provides a variable length field in which you can store comments.
Records Records –are collection of fields of data Record length –is a measure of maximum number of bytes a field can hold. Record type: –structure of record. Record occurrence : –entering data is referred as record occurrence. –Number and names of fields depends on the data to be entered in a field. –Number and names of fields depends on the data to be entered in a field.
Flat Files and Database Flat files Flat files –refers to data file which has same field names, field length and data types. –It is a single record type. –It is a single record type. –Not efficient for complex data management tasks. Database: –Variety of different record types related or consolidated into single unit. –Variety of different record types related or consolidated into single unit. –Two flat files can be combined or joined to perform calculations. –Two flat files can be combined or joined to perform calculations. –Highly suitable complex data management tasks. –They are difficult to design and maintain which is done by database administrator(,DBA).
Databases When a computer uses related record types from a database to calculate pay, it can combine two records to create a record that contains the data from both files.
Databases (continued) A database has more flexibility than a flat file but is more difficult to design and maintain. A database administrator supervises database design, development, testing, and maintenance. –Data redundancy –Data redundancy –Primary key –Primary key –Relationships –Relationships –Data integrity –Data integrity
Data Models A data model is a description of the way that data is stored in a database. –helps you understand the relationships between entities –helps you create efficient structure to hold your data –helps you create efficient structure to hold your data
Entity Relationships A relationship is an association between entities. Database designers graphically depict data models using diagramming techniques.
Entity Relationships (continued) A data diagram can also show cardinality A data diagram can also show cardinality –the number of occurrences that can exist between two record types. –the number of occurrences that can exist between two record types. Three possible types of cardinality are: –one-to-one –one-to-many –many-to-many
Entity Relationships (continued) Diagramming cardinality A one-to-one relationship is shown by using a single line to connect the boxes that represent record types. Employee Social Security Card TimecardJob Employee A one-to-many relationship is shown by adding a crows foot to the end of the line next to the record type with many occurrences. A many-to-many relationship is shown by adding a crows foot to both ends of the connecting line.
Entity Relationships (continued) One-to-one relationship –one record of a record type is related to only one record of another record type – - – - One-to-many relationship –one record in a record type may be related to more than one record of another record type – – Many-to-many relationship –one record in a particular record type can be related to many records in another record type and vice versa – –
Searching the Database/Information A collection of information, as an electronic filing system. Information are arranged as searchable collections are also known as Databases. Databases classified as Structured and Free form databases. Structured forms are arranged in an uniform format of records and fields. Free-forms are arranged loosely in the form of documents rather than as records. Data access software is the interface used to search for information on a Database Different databases have different data access software Depending on the data access software searching specifications using a menu, hypertext index, a keyword search, query by example or a query language
Menus and Hypertext Index Menus are similar to the ones used in most software Menus are being replaced by Hypertext index. In a Hypertext database, any object, whether it be a piece of text, a picture, or a film, can be linked to any other object. Hypertext databases are particularly useful for organizing large amounts of disparate information, but they are not designed for numerical analysis. Example links you to information in categories such as education, business, entertainment, society and politics.
Keyword Search Engine A program that searches documents for specified keywords and returns a list of the documents where the keywords were found Boolean operators OR, AND & NOT operators are allowed in keyword searches. Search engines –www.yahoo.com –www.google.com –www.lycos.com –www.altavista.com –www.askjeeves.com
Query by Example Query By Example (QBE) refers to method of forming queries in which the database program displays a blank record with a space for each field. You can then enter conditions for each field that you want to be included in the query. Eg:- for searching books through a catalogue
Query Language Query language is a specialized language consisting of a set of commands that directs the computer to –create databases, –locate information, –sort records and –change the data in those records. Consists of –command words, –syntax and –grammar. Knowledge of database and it structure is required. The de facto standard for query languages is SQL pronounced as SEQUEL
Data Management Software Data management software create relational, hierarchical, object oriented, web enabled collection of data. Helps enter and manipulate data. Different types of data management software depends on –the data model –flexibility you require to manipulate data –the resources allocated for data.
Data Management Software Different types of data management software: –Custom software: –File management software –Database management software –Object oriented software –Web enabled database
Custom Software Custom Software Developed using programming languages. Data files are manipulated using custom programs. Tailored to the exact needs of the organizations or businesses. Tailored to the exact needs of the organizations or businesses. Combination of custom programs and database components for flexibility and reducing the development time. Created for manipulating all network, relational, object oriented, web enabled data files.
File Management Software It allows specify field names, lengths, data types for the data files created. Provides method to manage, organize, locate, sort and prints the manipulated data in a data file. Data independence: separation of data from the programs manipulating it. It is data independent and adapt to any type of data file. The program performs the same function even if a additional field is included. Limitations: –Manipulate only one file at a time. –Manipulate only flat files. –Does not specify relationships between the data files.
Database Management Software Database management software manipulates with more than one file at a time. Defines relationships between different record types. Provides a way to create custom programs for data management tasks performed frequently. Provides client server option. –DBMS software is loaded into server which processes the requests for data from the DBMS software in client machine.
Object Oriented Tools Other type of data management software acts on passive set of data. It provides methods to manipulate data. To construct database it needs object oriented DBMS or object oriented language like Small Talk. Only the programs defining the object and classes are external to the DBMS.
Web-Enabled Database Tools Provides a way to access the database through internet by using a standard web browser. As HTML pages are static, it is impossible to create web pages that provide results for customers search. To interact with the web based database, pass requests from browser to the database and then send results back to browser. GGI programming provides this capability. –Programming languages such as Perl, C and Visual Basic. –CGI provides proprietary interfaces ISAPI and NSAPI. ASP(Active Server Pages) provides high speed and non proprietary interfaces. Cold Fusion a web database development tool to interact with the HTML pages without programming.
Software Engineering Body of techniques to create, manage large scale, complex software systems by a team of programmers. Body of techniques to create, manage large scale, complex software systems by a team of programmers. It contains –The software development Process –Define and redefine the problem –Plan a solution to the problem –Code the solution –Evaluate and test
Computer Programs On average, one programmer completes only 20 lines of code per day. Most commercial programs –are written by teams of programmers and –take months or years to complete. –a large program has over 1 million lines of code Computer programming cannot contain ambiguous instructions., Computer programming cannot contain ambiguous instructions.,
The Problem Statement The Problem Statement A problem statement defines certain elements that must be manipulated to achieve a result or goal. A good problem statement for a computer program: –specifies any assumptions that define scope of problem –specifies the known information –specifies when problem has been solved An assumption is something that you accept as true so as to proceed with the program design. For example, if you are comparing the price and quality of two pizzas, you can make the assumption that they are the same size and have the same toppings.
The Problem Statement (continued) The known information in a problem statement is the information that you supply to the computer to help it solve a problem. –often included in the problem statement as givens –often included in the problem statement as givens After identifying known information you specify how to determine when the problem has been solved. –specify the outcome you expect –specify the outcome you expect
Algorithms Algorithms An algorithm is a set of steps for carrying out a task, which can be written down or implemented. –like a recipe –like a recipe If an algorithm is formulated correctly, you are guaranteed to accomplish the task for which it was designed. If an algorithm is formulated correctly, you are guaranteed to accomplish the task for which it was designed.
Algorithms An algorithm for a computer program: An algorithm for a computer program: –is a set of steps that explains how to begin with the known information specified in a problem –explains how to manipulate the information to arrive at a solution To design an algorithm, –you could record the steps that you take to solve the problem. –Your algorithm should specify how to manipulate the information.
Expressing an Algorithm Expressing an Algorithm You can express an algorithm in: –structured English –Pseudocode –Flowcharts –object definitions
Expressing an Algorithm Structured English –is a subset of the English language with limited selection of sentence structures. Pseudocode –is a notational system for algorithms that has been described as a mixture of English and your favorite programming language. flowchart –is a graphical representation of the way that a computer should progress from one instruction to the next when it performs a task.
Expressing an Algorithm An example of a flowchart
Software Development Process Software Development Process Coding is relatively a small part of the software process. Includes the recognition of the needs and the other development phases till delivery and deployment. Hundreds of people are involved in a software process. They are: –People who define the needs for the software process. –People who decide the system requirements for the software process. –People who design and code the solution.
Define/Redefine the Solution Define/Redefine the Solution Two steps involved are: –Recognition of the needs : –Recognition of the needs : may arise from marketing or management, technical groups and it might come as a contract. –Specification of the requirements: –Specification of the requirements: process of polling the needs of the software system. Advisable to make tests and iterations with focus groups comprising of actual users.
Plan Solution Enumeration of alternatives: Enumeration of alternatives: –Enumerate the solutions for the software system after deciding the needs for the solution. –It may more than one each having its own compatibility with the system, ease of operation and system costs. System Requirements: System Requirements: –Designing the system requirements for the needs –Performing critical tests for the systems.
Code the Solution Implementation of the solution: –Coding for the solution is written in programming languages. –Decisions for needs are locked in design phase. –Details of method to write the code depends on the programmer. Programmer testing: –Programmers test the solution for its correct performance –Group of programmers read and comment on others code in code review session –System testing is by project leaders. System Acceptance: –Group of individuals test the software for a period of time under simulated and real settings.
Evaluate and Test the Solution Test in context: –The working systems will exhibit bugs that slipped past filters. –Design decisions will reveal their flaws. –Good systems demands for changes rather than bad ones. –Demand for additional features for the solution. –Additional features demands for redesign of the software solution. Redesign the solution: –Redesigning starts from the beginning of the solution.
Program Documentation Written documentation is external to the program and contains information about the program that is useful to programmers and the people who use it.
Program Documentation (continued) A program manual contains any information about the program that might be useful to programmers, including the problem statement and algorithm. –used by programmers –used by programmers Reference manuals are –used by people who use the program. –used by people who use the program. A technical writer specializes in explaining technical concepts and procedures, often by simplifying complex concepts for a non-technical audience. A technical writer specializes in explaining technical concepts and procedures, often by simplifying complex concepts for a non-technical audience.
Coding Computer Programs A problem statement and an algorithm are often combined into a document called the program specification. –a blueprint for a computer program Coding is the process of using a computer language to express an algorithm. –entering commands A person who codes or writes computer programs is called a computer programmer.
Program Sequence Sequential execution, in which the computer performs each instruction in the order in which they appear, is the normal pattern of program execution. An example of sequential execution Start End 1. PRINT This is the first line. 2. PRINT This is the second line.
Program Sequence (continued) Control structures are instructions that specify the sequence in which a program is executed. There are three types of control structures: –sequence controls –sequence controls –selection controls –selection controls –repetition controls –repetition controls
Sequence Control A sequence control structure changes the sequence, or order, in which instructions are executed by directing the computer to execute an instruction elsewhere in the program.
Sequence Control An example of a sequence control structure Start GOTO WIdget Widget End PRINT This is the first line. PRINT This is the second line. PRINT All done! Sequence Control (continued)
Experienced programmers prefer to use sequence controls other than GOTO. goto Experienced programmers prefer to use sequence controls other than GOTO. goto A subroutine procedure, module or function is a section of code that is part of a program, but not included in the main sequential execution path. A subroutine procedure, module or function is a section of code that is part of a program, but not included in the main sequential execution path.
Selection Controls A selection control structure (also known as a decision structure or a branch) tells a computer what to do based on whether a condition is true or false. –an example is an IF...THEN...ELSE command An example of decision control structureC
Software Models Open source code is available to change, copy and distribute freely. –Linux –Netscape Closed source code is not available to alter and protected by copyright laws –Microsoft Office applications and O/S –Broderbund software
Tools for Software Creation A compiler translates a program written in a high-level language into low-level instructions before the program is executed. The commands written in a high-level language are referred to as the source code. The resulting low-level instructions are referred to as the object code. When you use a compiled language, you must compile your program to produce executable program code.
Tools for Software Creation (continued) Editors are text based applications that allow creation of source code Debugger is a tool used to find errors in source code during executing or running the program Integrated Development Environment (IDE) is a tool that aids in creation of source code – JPad is an IDE for JAVA
Tools for Managing Software Creation and Management Programming Tools : Special applications used to write software. Programming Tools : Special applications used to write software. They are –Editors –Editors –Compilers –Compilers –Debuggers –Debuggers –Integrated Development Environments (IDEs) –Integrated Development Environments (IDEs)
Editors Other editors supports specific programming language –They have automation built in them and they track the syntax error in the program –they also track the semantic errors like checking the data type of the variables.
Compilers Compilers : takes program source code as input and produce object code for machine execution Program with errors are returned for correction. Some compilers rearrange the code for faster object code.
Debuggers Program failure is termed as Bug Debug: – to correct the error found in the program. The methods to debug –hand simulate the program –Program execution instruction by instruction and observing the results. –Tools are developed to inspect the state of the machine during execution. –Popular debugging tools are visual debuggers which provide the graphical representation of the programs execution.
Integrated Development Environment (IDE) IDEs comprises of –Editors –Compilers –Debuggers –Tools for program documentation and maintenance For example Microsoft Visual Studio, Metrowerks Code Warrior, eclipse, NetBean. –Some IDEs check the syntax –keeps track of semantic errors. –Makes moving from development cycle to another transparent.