DOC PREVIEW
Radford ITEC 110 - Lecture Notes

This preview shows page 1-2-3-4-5-32-33-34-35-65-66-67-68-69 out of 69 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1ObjectivesObjectives (continued)What Is a Program?I Speak ComputerTypes of Programming LanguagesSlide 7Low-level LanguagesAssembly Language StatementsAssembly Language Statements (continued)High-level LanguagesSlide 12Structure of a ProgramExample of PseudocodeChoosing and Testing the AlgorithmModifications to Pseudocode Based on TestingSyntax of a Programming LanguageLearning to Cook With JavaVariablesIdentifiers and Naming ConventionsVariable TypesSlide 22Slide 23Slide 24Slide 25String Data TypeHungarian NotationSlide 28Variable ContentOperatorsSlide 31Operators (continued)Slide 33Slide 34Slide 35Slide 36PrecedenceSlide 38Java Control Structures and Program FlowInvocationTop Down (Also Called Sequence)Blocks of CodeOutput DataSlide 44Input DataMore on InvocationSelectionSelection (continued)Slide 49Repetition (Looping)Repetition (continued)Ready, Set, Go!Object-Oriented ProgrammingSlide 54How OOP WorksOOP TerminologyOOP Terminology (continued)Slide 58InheritanceSlide 60EncapsulationPolymorphismJava and OOPChoosing a Programming LanguageOne Last ThoughtSummarySummary (continued)Slide 68Slide 69Connecting with Computer Science 2Objectives •Learn what a program is and how it can be developed•Understand the difference between a low-level and high-level language•Be introduced to low-level languages using the Assembly programming language as an example•Learn about the structure of a program, including algorithms and pseudocodeConnecting with Computer Science 3Objectives (continued)•Gain an understanding of the basics of high-level programming languages using Java as an example•Learn about variables and how they are used•Be introduced to the Java operators•Explore the different control structures used in programming•Understand the terms associated with object-oriented programmingConnecting with Computer Science 4What Is a Program?•A collection of statements that solve a problem•Must be converted into a language that the computer understands–Algorithm: logically ordered set of statements –Conversion process uses an interpreter or compiler•Interpreter translates statements one-by-one•Compiler reads all of the statements and creates a finished programConnecting with Computer Science 5I Speak Computer•Determine what language you want to use–Assembly for controlling hardware–Java and JavaScript for Internet applications–Lisp for working with artificial intelligence–Visual Basic for a simple yet powerful GUI programming environment–Others include. C, C++, Smalltalk, Delphi, and ADA, FORTRAN, and COBOLConnecting with Computer Science 6Types of Programming Languages•Low-level–Geared towards computer – less understandable or like human language–Machine language is lowest-level language–Assembly resides between lowest-level and higher-level languages•Assembler converts assembly code to machine language •High-level–Human-friendly languageConnecting with Computer Science 7Figure 11-1 Different types of programming languagesConnecting with Computer Science 8Low-level Languages•Machine language includes only binary numbers•Assembly uses more English-like statements–Each statement corresponds to one machine instruction–Programs run faster than programs in higher-level languages–Closely tied to particular CPU type–Harder to read and understand than higher-level languagesConnecting with Computer Science 9Assembly Language Statements•Consists of alphabetic instructions with operations and register indications–mov moves values aroundmov cx, 8–add adds one to value to anothermov cx, 3mov dx, 8add dx, cx–sub subtracts one value from anotherConnecting with Computer Science 10Assembly Language Statements (continued)–inc increments a value in the registerinc dx–cmp compares two valuesmov cx, 4mov dx, 7cmp dx, cx (zero flag is set if dx - cx = 0)–jnz jumps to a specific location in the programjnz stop (Jumps to the section named stop if the zero flag is set)Connecting with Computer Science 11High-level Languages•Easier to write, read, and maintain than low-level languages•Accomplishes much more in a single statement•Generally slower–Must be either compiler or interpreted•Many incorporate IDEs (integrated development environment’s)–Interface that includes an editor, compiler, graphic designer, and moreConnecting with Computer Science 12Figure 11-2Microsoft Visual Studio .NET makes software development easierConnecting with Computer Science 13Structure of a Program•Program structure is based upon algorithms, and is often represented using pseudocode–Algorithm: consists of executable steps to solve a problem–Pseudocode: readable description of an algorithm written in human language•Template for what needs to be converted into programming language syntaxConnecting with Computer Science 14Example of Pseudocode •Converting the temperature from Celsius to FahrenheitAsk the user for a temperature in FahrenheitApply the entered temperature to the formula CelsiusTemp = (5/9) * (Fahrenheit Temp - 32)Display the result saying Fahrenheit Temp ## converted to Celsius is XXConnecting with Computer Science 15Choosing and Testing the Algorithm•There can be many different ways to perform a task or accomplish a goal•Determine which algorithm is the best one to use for the project based on a myriad of factors•To test the algorithm, pretend that you are the end user and trying to run the program–Celsius conversion example: What if the user does not enter a number value?•Modify pseudocode to test for valid valuesConnecting with Computer Science 16Modifications to Pseudocode Based on TestingAsk the user for a temperature in FahrenheitIf the value entered is numericalApply the entered temperature to the formulaCelsius Temp = (5/9) * (Fahrenheit Temp - 32)Display the result saying Fahrenheit Temp ## converted to Celsius is XXElseDisplay a message stating that the value entered is NOT allowedConnecting with Computer Science 17Syntax of a Programming Language•Writing a program can be compared to following a recipe (the algorithm and pseudocode) to correctly combine the ingredients to produce a result (program)•Ingredients include–Variables–Operators–Control Structures–ObjectsConnecting with Computer Science 18Learning to Cook With Java•Java is a high-level programming language developed by Sun Corporation–Familiar syntax (similar syntax to


View Full Document

Radford ITEC 110 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?