Class Notes

Class Notes - CS 31 Introduction to Computer Science Notes:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 31 Introduction to Computer Science Notes: 10/3/07 Algorithm: A series of combined steps to solve a problem Programming Process: Types of Control Sequential: Step by Step Selection: One of the choices Repetition: Repeated Step Algorithm Design: Tools – Flow Charts, Pseudocode Psuedocode: - Structured Natural Language - Easy to understand - Easy to use in comments Program Practices: - Design before implementing - Use comments liberally - Develop incrementally - Reuse functions - Start early Programming Language Levels (Machine vs Human) - Machine Language o Language of the computer o Consists of 0 and 1 o Machine dependent o Lowest level o No limits - Assembly language o Simplified comp lang o Consists of symbols and operations o Machine dependent o Second lowest level o No limits: same as machine lang - High level language o Mathematical Language o Consists of mathematical statements o Machine independent (mostly) o Highest level (except natural) o Limited capability: not all operations
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
- Natural language Compilation Process High level -> Machine 1. Enter High level program 2. translate to assemblyh language 3. translate to machine language 4. combine with library functions 5. load into computer 6. run program User Steps 1. Enter high level program with editor 2. compile the program 3. fix the errors 4. run the program Many Types - FORTRAN: first, mathematical - COBOL: Early, English like - LISP, SNOBOL: Special purpose - ADA: DOD standard - C: operatin system implementation - C++: C: Invented to program unix OS, General purpose C++: Enhancement of C. OOP. Language for this course Function: - A single unit of computation o Accomplishes one thing o May use other functions o May produce a result o Sequence of statements Keywords/Identifiers: - letter or _ followed by letters, _, and digits - Don’t begin with _: used by compiler - Case sensitive - Unlimited length: compiler may use 32 - Multiple words: capitalize or use _ - Constants: Capitalize - Identifiers: Names of Data
Background image of page 2
- Keywords: Identifiers reserved for specific language use Data Types: - Integer: int o Discrete values o Counting numbers o Positive, negative, or zero o Values specified by decimal digits o No decimal point - Real: float – limited precision o Continuous values o Positive, negative, or zero o
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Class Notes - CS 31 Introduction to Computer Science Notes:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online