1 / 26

Algorithm development

Algorithm development. The invention of the computer. Programming language developments: Machine code Assembler easier to write, debug, and update High level languages strive to be machine independent easier to learn and use 1954 – FORTRAN 1961 – COBOL then ALGOL, LISP, BASIC

perry-mejia
Download Presentation

Algorithm development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Algorithm development

  2. The invention of the computer • Programming language developments: • Machine code • Assembler • easier to write, debug, and update • High level languages • strive to be machine independent • easier to learn and use • 1954 – FORTRAN • 1961 – COBOL • then ALGOL, LISP, BASIC • 1970 – Pascal • 1980’s – C • 1990’s – C++, Java (originally called ?) • and many, many others

  3. High level langauges (HLL) • Not directly understood by the computer • Humanly readable • Requires the user of a compiler • Compiler = program • Input = code written in a HLL • Output = machine code

  4. Pascal (an HLL) • 1970’s • Support for “structured programming” • Control constructs • Linear sequence of commands/instructions • Repetition • Selection • Top-down programming • Problem is broken down into a series of smaller problems which are solved. • Divide-and-conquer technique.

  5. Types of software • OS (operating system) • Programming environment/tools • Applications

  6. Operating Systems (OS) • Windows • Linux • Android (linux-based) • Unix • Mac OS • many others

  7. Programming environments/tools • Tools • emacs (an editor – not a word processor) • vi • g++ • gdb

  8. Programming environments/tools • IDE’s (Integrated Development Environment) • consist of: editor, compiler or interpreter, debugger, linker • examples: jGrasp, netbeans, Eclipse, Ready, Visual C++, Visual BASIC, JBuilder, and many others

  9. Applications • Computer games • Word processors • Graphics packages • Virtual reality software • Web browsers • Presentation • Database • Spreadsheet • And many others.

  10. Social issues • Privacy/anonymity • Quality of information

  11. Program development • Our programming language is Java. • The IDE we will use is jGrasp. • Editor is used to type in program text (it is not a word processor; don’t use a word processor). • Compiler (syntax errors) • Run/execute (semantic errors)

  12. Program development • Java is an object-oriented language. • (Note: Case sensitive.) • Method • named operation • constructor (ctor) • special method w/ same name as class • performs initialization • class may have more than 1 ctor • Class • named group of related methods

  13. Recall “What is a computer?” INPUT (information) PROCESSING OUTPUT (information) MEMORY

  14. Definitions (from http://mathworld.wolfram.com/Algorithm.html) • An algorithm is a specific set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point.

  15. Definitions (from http://mathworld.wolfram.com/Algorithm.html) • Specific algorithms sometimes also go by the names: • method • procedure • routine • subroutine • technique

  16. Definitions (from http://mathworld.wolfram.com/Algorithm.html) The word “algorithm” is a distortion of al-Khwārizmī, a Persian mathematician who wrote an influential treatise about algebraic methods.

  17. Definitions (from http://mathworld.wolfram.com/Algorithm.html) The process of applying an algorithm to an input to obtain an output is called a computation.

  18. Recall “What is a computer?” • How can a Java program perform output? INPUT (information) PROCESSING OUTPUT (information) MEMORY

  19. How can a program perform output? System.out.println( "hello world" );

  20. blocks { System.out.println( "Welcome!" ); System.out.println( "Enjoy the show." ); }

  21. Method/function/procedure public static void main ( String param[] ) { System.out.println( "hi there" ); }

  22. Defining our own objects class MyFirstClass { public static void main ( String param[] ) { System.out.println( "hi there" ); } }

  23. Recall “What is a computer?” • How can a Java program perform input? INPUT (information) PROCESSING OUTPUT (information) MEMORY

  24. How can a Java program perform input? … Scanner s = new Scanner( System.in ); … String str = s.nextLine(); …

  25. We can mix input and output. Scanner s = new Scanner( System.in ); System.out.print( "Enter your name: " ); String name = s.nextLine(); System.out.println( "Thanks." ); s.close();

  26. Complete program that does both input & output. import java.util.Scanner; class MySecondClass { public static void main ( String param[] ) { Scanner s = new Scanner( System.in ); System.out.print( "Enter your name: " ); String name = s.nextLine(); System.out.println( "Thanks." ); s.close(); } }

More Related