Instructor: Zhe He Department of Computer Science

Slides:



Advertisements
Similar presentations
Computers Are Your Future
Advertisements

Creating Computer Programs lesson 27. This lesson includes the following sections: What is a Computer Program? How Programs Solve Problems Two Approaches:
Professor Michael J. Losacco CIS 1150 – Introduction to Computer Information Systems Programming and Languages Chapter 13.
Software. What Is Software? software –Also called Computer programs –Are a list of instructions –Instructions are called code –CPU performs the instructions.
Programming System development life cycle Life cycle of a program
Chapter Concepts Review Markup Languages
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
© Prentice Hall CHAPTER 3 Computer Software.
Russell Taylor Lecturer in Computing & Business Studies.
Chapter 10 Application Development. Chapter Goals Describe the application development process and the role of methodologies, models and tools Compare.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 3 Software Two major types of software
4.01B Authoring Languages and Web Authoring Software 4.01 Examine webpage development and design.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Building Applications.
Your Interactive Guide to the Digital World Discovering Computers 2012.
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Chapter 13 Programming Languages and Program Development 1.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter Lead Black Slide Powered by DeSiaMore Powered by DeSiaMore.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
CC111 Lec#5: Program Development 1 Program Development and Programming Languages Lecture 4 Reference :Understanding Computers Chapter 13.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
Chapter 15 Program Development and Programming Languages.
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Programming Languages and the Programming Process.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Introduction to Computers Lesson 13A. home Computer Program A set of instructions or statements, also called code, to be carried out by the computer’s.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 13 A & B Programming Languages and the.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Part 1 The Basics of Information Systems. Purpose of Information Systems Information systems ◦ Collects, stores and organizes information ◦ Retrieves.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
Chapter 13 Programming Languages and Program Development
Evolution and History of Programming Languages
IS220 Computer Programming
CMIT100 Chapter 14 - Programming.
Topics Introduction Hardware and Software How Computers Store Data
CSCI-235 Micro-Computer Applications
Course: Introduction to Computers
Programming Concepts and Languages
Objectives Overview Differentiate between machine and assembly languages Identify and discuss the purpose of procedural programming languages, and describe.
Chapter 4 Computer Software.
Chapter 12 Programming Concepts and Languages.
Unit# 9: Computer Program Development
Chapter 27 WWW and HTTP.
Chapter 6 System and Application Software
Topics Introduction Hardware and Software How Computers Store Data
Chapter 10: Behind the Scenes Software Programming
Chapter 1 Introduction(1.1)
CS105 Introduction to Computer Concepts Intro to programming
Programming.
Creating Computer Programs
and Program Development
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Chapter 6 System and Application Software
Chapter 6 System and Application Software
Creating Computer Programs
Chapter 6 System and Application Software
CS105 Introduction to Computer Concepts Intro to programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Spring 2013 CS 103 Computer Science – Business Problems Lecture 15: Intro to Programming Instructor: Zhe He Department of Computer Science New Jersey Institute of Technology 12/8/2018

What Is a Computer Program? Computer programs Also called software Are a list of instructions Instructions are called code CPU performs the instructions Three types Operating system Utility Application Teaching tip Chapters 7 and 8 cover software in great detail.

Software Is Stored In Many Files Executable files Contain the instructions for the CPU Have extensions of .exe, or .com Teaching tip Open a folder and demonstrate each file. Show what happens when you open each file type.

Software Is Stored In Many Files Dynamic link libraries Partial executable file Used to support executable files Have .dll extensions

Software Is Stored In Many Files Initialization files Contain configuration settings for software Have a .ini extension Modern programs use the registry

Software Is Stored In Many Files Help files Contain information about the software Information is indexed and searchable Provides an online manual Have a .chm or .hlp extension Teaching tip Most Windows programs provide help by hitting the Help menu or pressing F1. This will open the Windows Help program and display the help appropriate to the application that launched the help.

Software Is Stored In Many Files Batch files Used to automate tasks Hold a series of OS commands Have a .bat extension

Hardware/Software Interaction Program execution Software executes at the CPU level Code to play a sound Code generates an interrupt CPU tells the sound card to play Sound card plays the file Programmer creates the code Discussion point Page 501 states “Computers are the reason people purchase computers”. This is an excellent quote. Have students list all the things that they do with computers. When done, point out that the majority of items are handled by a software application.

Hardware/Software Interaction Code Statements written in a programming language Writing code can be tedious Code must be perfect Order of steps must be exact Writing code is quite exciting Problems are solved New ideas are formed

Writing Code

Hardware/Software Interaction Machine code Recall that computers think in binary Code is translated into machine code CPU executes the machine code CPUs have a unique machine code Teaching tip Figure 13A.4 on page 502 shows an example of binary code.

Hardware/Software Interaction Programming languages Simplifies the writing of code English is used to describe the binary Original code is called source code Several hundred languages exist Teaching tip It is a good idea to show a few different programming environments. In particular, show the same program (Hello World works well) in several different languages. Point out that the result is the same, but the syntax is very different.

Hardware/Software Interaction Compilers and interpreters Converts source code into binary Allows code to execute Checks source code for correctness

Hardware/Software Interaction Compiler Creates an executable file Contents are called object code Executable can run on its own Each language has its own compiler C++ and Java are compiled languages

Hardware/Software Interaction Interpreter Runs program one line at a time More flexible than compilers Slower than compilers Always needed to execute program Visual Basic and Perl are interpreted

Planning a Computer Program Plans The steps to solve a problem Describe the expected results Programming without a plan is difficult Teaching tip Imagine driving from New York City to Los Angeles without a map, directions, cell phone or street signs. This is programming without a plan.

Planning Tools Pseudo code Natural language statements that resemble code Describes what must be done Can be written by non programmers Programmers develop unique versions

Compare two values and output the bigger one 12/8/2018

Order three number (increasing) 12/8/2018

Planning Tools Input-processing-output (IPO) charts Determines what is needed Input column Data inputted by the user Processing column Pseudo code describing the problem solution Output column Desired output from the program

IPO Chart

How Programs Solve Problems Program control flow Order program statements are executed Typically executed in order Constructs can change the flow Decision statements Loops Teaching tip Briefly describe a loop and an if statement here.

How Programs Solve Problems Algorithm Set of steps Always leads to a solution Steps are always the same Flowcharts can describe algorithms Structured tool for drawing algorithms Algorithms appear in all programs Teaching tip Figure 13A.8 on page 505 shows a flowchart.

Flowchart

How Programs Solve Problems Heuristic Set of steps Solution is usually found Solution may not be optimal Used when algorithms fail Algorithm is nonexistent or too complex Appear in more complex applications Data mining Anti-virus software Teaching tip Data mining was introduced in chapter 11B.

Structured Programming Programming using defined structures Creates easy to read code Programs are efficient and run fast Several defined structures Teaching tip While lecturing, have a sample program open that incorporates all of the followings structures.

Structured Programming Sequence structure Describes the flow of the program Typically executed in order Branching statements allow multiple flows

Structured Programming Selection statement Also called conditional statement Performs a true or false test Determines which code to execute next Teaching tip Driving a car provides several examples of selection statements. The selection statements for an intersection with a traffic light provide three statements for discussion.

Structured Programming Repetition statements Also called looping structures Repeats a section of code Until an exit condition is reached Teaching tip Discuss the algorithm for walking up a flight of stairs. It becomes apparent that a loop is needed in the algorithm. The loop exits at the top of the stairs.

Object Oriented Programming Also known as OOP Enhances structured programming Intuitive method of programming

Object Oriented Programming Code reuse Code used in many projects Speeds up program development Simplifies program development

Object Oriented Programming Develops objects All real world items are objects OOP develops code versions Contains data about the item Contains functionality Object encapsulates both into one package Teaching tip Provide an example of an object. I often use a lead pencil. Data includes the size and type of lead. Functionality includes write, erase, extendLead, extractLead and replenishLeadSupply.

Programming Languages Used to generate source code Avoids using machine code Have strict rules of syntax Symbols and punctuation have meaning Spelling must be exact Code is converted into machine language Insider information Older languages such as COBOL and Fortran actually required developers to place different coding statements in different columns on the screen.

Language Categories First generation language Machine languages Written in binary Different for every CPU

Language Categories Second generation languages Assembly languages Statements that represent machine code Code converted by an assembler Still used to optimize video games

Language Categories Third generation languages (3GL) First higher level language Supports structured and OOP Code is reusable Code is portable Typically written in an IDE C/C++ creates games and applications Java creates web applets ActiveX creates Web and Windows applets

Language Categories Fourth generation languages (4GL) Easier to use than 3GL Coded in a visual IDE Tools reduce the amount of code Object oriented programming Microsoft .Net is a language Dream Weaver is an 4GL IDE

Microsoft.NET

Language Categories Fifth generation language (5GL) Mystery language May not be created yet Will create software automatically

WWW Development Languages Markup languages Describe how the text is formatted Hyper Text Markup Language (HTML) Basis of all web pages Defines web structure using tags Easy to learn and use Created with a text editor

WWW Development Languages Extensible Markup Language (XML) Stores data in a readable format Looks like HTML Allows developers to create tags Depends on HTML for formatting

XML

WWW Development Languages Extensible HTML (XHTML) Newer version of HTML Stricter rules Based on XML rules Teaching tip Be sure to emphasize that all web technologies at some point need HTML or XHTML to present data in a browser.

WWW Development Languages Extensible Style Sheet Language (XSL) Format and displays XML documents Rules that dictate formatting Create a standard web page

WWW Development Languages Extensible HTML Mobile Profile XHTML MP Initially Wireless Markup Language (WML) Creates pages viewable on a handheld

WWW Development Languages Cascading Style Sheets (CSS) Format HTML, XHTML and XSL Applies consistent formatting to all pages Teaching tip Students wishing to learn about the web technologies should visit www.w3schools.com. W3schools.com offers several free tutorials covering nearly every mainstream web technology.

WWW Development Languages Web authoring environments Reduces tedium for creating pages Tools that simplify web site creation Macromedia Dream weaver Simplifies large sites CSS support is exceptional Microsoft FrontPage simplifies large sites Macromedia Flash creates web animations Teaching tip For a fun example of what Flash can do, check out www.homestarrunner.com and watch the exploits of Strong Bad.

WWW Development Languages Scripting languages Create dynamic web pages Change based on user input HTML can create static pages Page is generated as needed

WWW Development Languages JavaScript Developed by Netscape Works inside of HTML Page verification and simple animation Based on Java

WWW Development Languages Active Server Pages (ASP) Developed by Microsoft Based on Visual Basic Good at connecting to Microsoft databases Runs only on Microsoft servers

WWW Development Languages Perl Old UNIX language Found on all Windows and Linux servers Excellent web scripting language

WWW Development Languages Hypertext Pre-Processor (PHP) Especially good at connecting to MySQL Very popular language Runs on UNIX and Windows

Systems Development Life Cycle SDLC Organized way to build programs Consists of five phases

Systems Development Life Cycle Phase 1: Needs Analysis Users identify a need Need is clearly defined using tools

Systems Development Life Cycle Phase 2: Systems design Solution to the need is defined Many tools are used Prototypes of the solution are built

Systems Development Life Cycle Phase 3: Development Solution to the problem is built Programmers write the solution Technical writers document the process Solution is continually tested

Systems Development Life Cycle Phase 4: Implementation The solution is installed Users are converted to the new system Trainers are important in this phase

Systems Development Life Cycle Phase 5: Maintenance IT professionals monitor the product Bugs are found and fixed New features are added