1 / 22

CSE:141 Introduction to Programming

CSE:141 Introduction to Programming. Faculty of Computer Science, IBA BS-I (Spring 2010). Lesson Plan. Introduction of the course. Methodology used to conduct this course Topic to be discussed Identify the different components of a computer

cody-duffy
Download Presentation

CSE:141 Introduction to Programming

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. CSE:141 Introduction to Programming Faculty of Computer Science, IBA BS-I (Spring 2010)

  2. Lesson Plan • Introduction of the course. • Methodology used to conduct this course • Topic to be discussed • Identify the different components of a computer • Know about programming languages and their categories. • Program Development Process Quratulain

  3. Course Objective • Provide solid foundations in the basic concepts of programming. • Focuses on common computational problem solving techniques. • Use Java for implementation. Quratulain

  4. Goals • Develop skills in • computational thinking • ability to use vocabulary used in programming • ability to map described problem into program that are appropriate for problems that might occur in practice. Quratulain

  5. Text/Reference Books • Java: How to program, Deitel and Deitel • Programming and problem solving with Java by Nell Dale and Chip Weems • Introduction to Programming with Java: A Problem Solving Approach by John Dean, Park University—Parkville and Ray Dean, University of Kansas—Lawrence • Java: An Introduction to Problem Solving and Programming, 5/E by Walter Savitch • Kernigan, Brian W. and Dennis M. Ritchie, The C Programming Language, Second Edition (Prentice-Hall, 1988) • JAVA for Programmers, Paul J. Deitel and Harvey M., DeitelDeitel Developer Series, Prentice Hall • How to Program Using Java by Tony Jenkins and Graham Hardman Palgrave MacmillanJava in a Nutshell by David Flanagan, O'Reilly Press Quratulain

  6. Tentative Topics List • Functions and Design • Arrays • Linear & Binary Search • Sorting • Multidimensional Arrays • Structures • Strings • Nested Data Structures • File Input/Output • Program Style • Structuring Program Files • Recursive Binary Search • Recursion • Switch Statement • Overview of programming • Basic control flow • Functions • Overview and Welcome • Problems, Algorithms and Programs • Variables, Values and Types • Arithmetic Expressions • Input and Output (I/O) • Conditionals • Functions • Function Parameters • Iteration • Loop Development • Complex Conditions Quratulain

  7. Tools/IDEs • Java Standard Edition (SE) and JDK 6 • Eclipse • Netbeans Quratulain

  8. Web Resources • http://java.sun.com/j2se/ (Standard Edition)http://www.eclipse.orghttp://java.sun.com/docs/books/tutorial/java/http://www.javaworld.comhttp://jcp.orghttp://eclipsetutorial.sourceforge.net/totalbeginner.html Quratulain

  9. Grading Policy Midterm Exam: 30% Final Exam: 40% Quizzes: 10% Assignments: 10% Term Project: 10% Quratulain

  10. Contact Information Instructor: Quratulain Office: Room 12, City Campus Counselling hours: Wednesday and Saturday (2:00 to 5:00) Cell: 03452324452 Office: 111677677 (ext.1325) Email: quratrajput@yahoo.com Website: quratulainrajput.iba.edu.pk Quratulain

  11. Introduction • Programs takes input and produce output according to the described instructions. • Computer has two major component: • Hardware(memory, processor, I/O devices) • Software(system and application programs, compilers) Quratulain

  12. Software Categories • A software is the program which contains a list of instructions that a computer uses in order to function. • System Programs • Programs that are needed to keep all the hardware and software systems running together smoothly. • Examples: Operating Systems like Linux, Windows, Unix, Solaris, Mac OS • Application Program • Programs that people use to get their work done. • Examples: Word Processor, Game programs, Spreadsheets • Compilers • It is a program to transforms high level code into machine level that is understandable by machines. Quratulain

  13. Introduction to Programming • A programming language is a standardized communication technique for expressing instructions to a computer. • There are different types of programming languages that can be used to create programs such as: Java, Pascal, C, C++, C#, visual basic • To execute a program regardless of any language instructions are translated into machine language that can be understood by computers. Quratulain

  14. Categories of Programming Languages • High level Languages • It is more user friendly, to some extent platform-independent, and abstract from low-level computer processor operations such as memory accesses. • A programming statement may be translated into one or several machine instructions by a compiler. Examples are Java, C, C++, Basic, Fortran • Low level • Assembly languages are similar to machine languages, but they are much easier to program in because they allow a programmer to substitute names for numbers, and each instruction is translated into one machine instruction by an assembler program. • Note: the term high level and low level are inherently relative, Originally, assembly language was considered low-level and COBOL, C, etc. were considered high-level. Many programmers today might refer to these latter languages as low-level. Quratulain

  15. Program Development Process • The basic steps in trying to solve a problem on the computer are: • Problem Definition • Problem Analysis • Algorithm design and representation (Pseudocode or flowchart) • Coding and debugging Quratulain

  16. Problem Definition • The problem must be well and clearly defined first in terms of its input and output requirements. • A clearly defined problem is already half the solution. • Computer programming requires us to define the problem first before we even try to create a solution. Example • “Create a program that will determine the number of times a name occurs in a list.” Quratulain

  17. Problem Analysis • After the problem has been defined, the simplest, efficient and effective approach to solve the problem must be formulated. • Usually, this step involves breaking up the problem into smaller and simpler sub-problems. Problem: • Determine the number of times a name occurs in a list Input to the program: • list of names • name to look for Output of the program: • the number of times the name occurs in a list. Quratulain

  18. Algorithms Design and Representation • An Algorithm is a clear and unambiguous specification of the steps needed to solve a problem. • It may be expressed in either Human language (English). • A graphical representation like a flowchart. • A code representation like a pseudocode. Quratulain

  19. Expressing Solution Through Human Language 1. Get the list of names 2. Get the name to look for, let's call this the keyname 3. Compare the keyname to each of the names in the list 4. If the keyname is the same with a name in the list, add 1 to the count 5. If all the names have been compared, output the result Quratulain

  20. Expressing Solution Through Pseudocode • Let nameList = List of Names • Let keyName = the name to be sought • Let Count = 0 • For each name in NameList do the following • if name == keyName • Count = Count + 1 • Display Count Quratulain

  21. Expressing Solution Through Flowchart Quratulain

  22. Coding And Debugging • Using the algorithm as basis, the source code can now be written using the chosen programming language. This process is called coding. • The programmer has to add some fixes to the program in case of errors (also called bugs) that occurs in the program. This process is called debugging. Quratulain

More Related